js 转码 和 .Net 后台解码

为防止 中文乱码,js传值要转码,当js 用 escape() 转码时,.Net 后台可以用 HttpUtility.UrlDecode() 进行解码。

例如:

  document.cookie = "city=" +escape($(this).html());
  string city = HttpUtility.UrlDecode(HttpContext.Current.Request.Cookies["city"].Value);

原文地址:https://www.cnblogs.com/awake-insist/p/4962301.html