主页面:
function showdetail(userName) { var result = window.showModalDialog('userDetail.aspx?userName=' + userName, '', 'dialogWidth=835px;dialogHeight=400px;status=no'); if (result == "refresh") { window.location.reload(); //当window.showModalDialog窗口关闭时执行 } }
弹出页面的page_load方法里面:
userName = Request.QueryString["userName"].ToString() ; //获取用户id
英文和数字没问题,汉字出现乱码,解决方法:
在Web.config 文件的<system.web>节点中添加
<globalization uiCulture="zh-cn"
culture="zh-cn" requestEncoding="gb2312"
responseEncoding="gb2312"/>
即:
<system.web> <globalization requestEncoding="gb2312" responseEncoding="gb2312" uiCulture = "zh-CHS" culture = "zh-cn" /> <httpHandlers> <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" /> </httpHandlers>
注意是gb2312,utf-8是不行的