Request.Url 无法读取当前页面地址中的中文参数比如:
搜索“农业”
地址栏为:
http://localhost/search.aspx?str=%c5%a9%d2%b5&newsid=2594941string strUrl = Request.Url.ToString().Trim(); 后变为:
http://localhost/search.aspx?str=??&newsid=2594941中文参数变乱骂了
希望有人好心帮忙一下

解决方案 »

  1.   

    修改Web.Config
    原: <globalization fileEncoding="gb2312" requestEncoding="gb2312" responseEncoding="gb2312"/> 
    修改为:    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />中文参数正常传递!!!
      

  2.   

    Server.HtmlDecode(Request.QueryString["str"])
      

  3.   

    试试先用Server.UrlEncode编码,然后接收的时候用Server.UrlDecode解码看看
      

  4.   

    地址栏里最好不要出现中文,用HtmlEncode编码一下,然后再用HtmlDecode解码
      

  5.   

    document.contform.action="http://xxx.xxx.com/serarch.aspx?str="+escape("农业");   
      document.contform.submit();escape函数编码的中文字符,POST过去必须用unescape解码