JDP 發表於 2015-10-20 09:35:31

Response.Redirect which POSTs data to another URL

Response.Clear();

StringBuilder sb = new StringBuilder();
sb.Append("<html>");
sb.AppendFormat(@"<body onload='document.forms[""form""].submit()'>");
sb.AppendFormat("<form name='form' action='{0}' method='post'>",postbackUrl);
sb.AppendFormat("<input type='hidden' name='id' value='{0}'>", id);
// Other params go here
sb.Append("</form>");
sb.Append("</body>");
sb.Append("</html>");

Response.Write(sb.ToString());

Response.End();Reference:
Response.Redirect which POSTs data to another URL in ASP.NET
http://stackoverflow.com/questions/6062078/response-redirect-which-posts-data-to-another-url-in-asp-net
Redirect and POST in ASP.NET
http://www.codeproject.com/Articles/37539/Redirect-and-POST-in-ASP-NET
頁: [1]
查看完整版本: Response.Redirect which POSTs data to another URL