开发者

Post XML Data to aspx page and reditect to the page from code behind

I need to post some xml data to a different aspx page and redirect to the same page. I tried the following code it does post to the page sucessfully but i need to redirect to the same page with posted data

         req.Method = "开发者_运维百科POST";       
        req.ContentType = "text/xml";     
        StreamWriter writer = new StreamWriter(req.GetRequestStream());
        writer.WriteLine(doc.InnerXml);
        writer.Close();
        rsp = req.GetResponse();

could you guys help me with this?

Thank in advance!!!


Response.Redirect should work:

rsp.Redirect(url);


What you're asking for is impossible in it's current form, this is due to the way HTTP works.

When you use POST you simply send data to the server, and collect the result. If you then want to show the user that page, you'll have to make a new request by the way of GET.

The easiest way to do this in asp.net is using Response.Redirect().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜