Url传值,传入中文,读取时出现乱码的解决方案

1.把传入的中文值进行加密

   string name = Server.UrlEncode("中文");
       Response.Redirect(string.Format("页面?Name={0}",name));

2.读取的时候再进行解密

  

View Code
if (!string.IsNullOrEmpty(Request.QueryString["Name"]))
{
Server.UrlDecode(Request.QueryString["Name"]);
}
 
  

你可能感兴趣的:(解决方案)