C# JS URL 传参出现乱码的解决方法

来源:互联网 发布:艾弗森身体数据 编辑:程序博客网 时间:2024/05/16 13:42
在传参是先编码在传输,接受时先编码,在接收。

string mm=Server.URLEncode(你);
Response.Redirect(index.aspx?mm=+mm);

然后在接收页解码:
string mm = Server.URLDecode(Requext.querystring(mm));

js:

传参:用encodeURI("url参数")将url编码

收参:用decodeURI("接收到的值")解码

原创粉丝点击