找回密碼
 註冊
搜索
查看: 3542|回復: 0

Response.Redirect which POSTs data to another URL

[複製鏈接]
發表於 2015-10-20 09:35:31 | 顯示全部樓層 |閱讀模式
[mw_shl_code=javascript,true]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();[/mw_shl_code]Reference:
Response.Redirect which POSTs data to another URL in ASP.NET
http://stackoverflow.com/questio ... ther-url-in-asp-net
Redirect and POST in ASP.NET
http://www.codeproject.com/Artic ... and-POST-in-ASP-NET
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-11-21 14:29 , Processed in 0.020479 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表