在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