asp.net中url传中文时乱码的问题

解决方法1:

在web.config中按如下代码改正

 <    

    globalization
        fileEncoding="gb2312"
        requestEncoding="gb2312"
        responseEncoding="gb2312"
        culture="zh-CN"     

 />

 

 

解决方法2:

页面1..aspx.cs文件,

Response.Redirect("~/Common/SearchAndViewComment.aspx?bookParameter=" + Server.UrlEncode(soso_text.Text));

页面2..aspx.cs文件,

 var bookParameter = Server.UrlDecode(Request.QueryString["bookParameter"]);

 

继续浏览观察结果,问题解决!

 

posted @ 2012-03-23 19:40  Seaurl  阅读(159)  评论(0编辑  收藏  举报