在传参是先编码在传输,接受时先编码,在接收。

string mm=Server.URLEncode(你);

Response.Redirect(index.aspx?mm=+mm);

然后在接收页解码:

string mm = Server.URLDecode(Requext.querystring(mm));

js:

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

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

 

js传递参数,c# 接收参数 :

escape(s)

Server.URLDecode(Requext.querystring(s));

如果是url重写后的中文参数:

escape(escape(s))  这个是本人尝试了很多次之后得出来的

Server.URLDecode(Requext.querystring(s));

 

相关文章:

  • 2021-08-01
  • 2022-12-23
  • 2021-09-22
  • 2021-06-17
  • 2021-09-02
  • 2021-06-13
  • 2021-08-07
  • 2021-11-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案