日期:2014-05-17  浏览次数:20530 次

后台怎么post跳转
一般post都是点击sumbit。我想先跳到一个中间页,拼接一下传过来的数据,然后再post到第三个页面。
但是中间页没有sumbit。怎么实现?

------解决方案--------------------
//以文件流POST方式发送
  postData += ("&hashcode=" + GetMD5String(pwd));
            //byte[] data = encoding.GetBytes(postData);
            byte[] data = System.Text.Encoding.UTF8.GetBytes(postData);

            // Prepare web request...
            HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://18dx.cn/API/Services.aspx");
            myRequest.Method = "POST";
            myRequest.ContentType = "application/x-www-form-urlencoded";
            myRequest.ContentLength = data.Length;
            Stream newStream = myRequest.GetRequestStream();
            // 发送数据
            newStream.Write(data, 0, data.Length);
            newStream.Close();


------解决方案--------------------
晕,怎么搞成css标记了?
//在后台以文件流POST方式发送
  postData += ("&hashcode=" + GetMD5String(pwd));
            //byte[] data = encoding.GetBytes(postData);
            byte[] data = System.Text.Encoding.UTF8.GetBytes(postData);

            // Prepare web request...
            HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://18dx.cn/API/Services.aspx");
            myRequest.Method = "POST";
            myRequest.ContentType = "application/x-www-form-urlencoded";
            myRequest.ContentLength = data.Length;
            Stream newStream = myRequest.GetRequestStream();
            // 发送数据
            newStream.Write(data, 0, data.Length);
            newStream.Close();


------解决方案--------------------
利用webrequest对象就可以了.
可以参考一下这个方法:
webrequest下的post方法示例

------解决方案--------------------
嗯 用LS的几种方法就可以了,但是只是发送post请求,并不能跳转过去

不过LZ这样的是可以在你的中间页面里面加一个windon.onload事件(窗体加载完成  javascript)

里面去触发submit的click事件就可以了 可能需要引入jquery库来模拟触发


<!DOCTYPE html>