asp.net 个别页面URL参数出现中文乱码的解决方法
在cs文件里传参的时候用UrlEncode:
Response.Redirect("B.aspx?Name="+Server.UrlEncode(Name));
接参的时候用UrlDecode:
Response.Write(Server.UrlDecode(Request.QueryString["Name"]));
脚本儿里传参的时候用escape:
location.href = "B.aspx?Name="+escape(Name);
接参的时候仍然用UrlDecode:
Response.Write(Server.UrlDecode(Request.QueryString["Name"]));
Response.Redirect("B.aspx?Name="+Server.UrlEncode(Name));
接参的时候用UrlDecode:
Response.Write(Server.UrlDecode(Request.QueryString["Name"]));
脚本儿里传参的时候用escape:
location.href = "B.aspx?Name="+escape(Name);
接参的时候仍然用UrlDecode:
Response.Write(Server.UrlDecode(Request.QueryString["Name"]));
作者:hjldare
Q Q:1527562807