传递:
Response.Redirect("show.aspx?id="+ HttpUtility.UrlEncode("中国"));
接收:
String sGet = HttpUtility.UrlDecode(Request.QueryString["id"]);
Response.write(strGetString)
Response.Redirect("show.aspx?id="+ HttpUtility.UrlEncode("中国"));
接收:
String sGet = HttpUtility.UrlDecode(Request.QueryString["id"]);
Response.write(strGetString)
本文介绍了一种使用HTTP请求进行页面跳转并处理URL编码的方法。通过Response.Redirect结合HttpUtility.UrlEncode实现页面跳转时参数的正确编码,再利用HttpUtility.UrlDecode在目标页面解析请求字符串,确保了数据传递的准确性。
884

被折叠的 条评论
为什么被折叠?



