在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"]));
转载于:https://www.cnblogs.com/hjldare/archive/2011/06/03/2072042.html