在客户端传递中文编码:
在客户端使用
escape()方法对要传递的中文编码
例
<script>
var strEN="中文" ;
window.location.href="Test.aspx?StrValue="escape(strEN);
</script>
在服务器端解码的代码如下:
在服务器端添加引用:Microsoft.JScript
string strEN=Microsoft.JScript.GlobalObject.unescape(Request["StrValue"].Trim());
在服务器端传递中文:
string name = "中文参数";
response.redirect("B.aspx?"+(Server.UrlDecode(name));
接收: