当前位置: 代码迷 >> ASP.NET >> 为何showModalDialog("PopForm.aspx?value=卡号")接受中文参数是乱码,该怎么解决
  详细解决方案

为何showModalDialog("PopForm.aspx?value=卡号")接受中文参数是乱码,该怎么解决

热度:9551   发布时间:2013-02-26 00:00:00.0
为何showModalDialog("PopForm.aspx?value=卡号",..)接受中文参数是乱码
前台语句
window.showModalDialog( "PopForm.aspx?value=卡号 ",...)
在PopForm.aspx页面的Page_Load事件中接收   Page.Request[ "value "]为乱码,难道无法接收中文参数。谢谢。


------解决方案--------------------------------------------------------
webconfig里
<globalization
requestEncoding= "utf-8 "
responseEncoding= "utf-8 "
/>

改成
<globalization
requestEncoding= "gb2312 "
responseEncoding= "gb2312 "
/>
试试

还有那个Server.HtmlEncode和Server.UrlEncode也可以用用
------解决方案--------------------------------------------------------
window.showModalDialog( "PopForm.aspx?value= "+escape( '卡号 ')+ " ",...)
  相关解决方案