解决页面之间传输中文乱码的问题
在.net中没有发现打开新窗口的功能,只好用老方法来实现,但是却发现这样的功能不能传递中文参数。郁闷。
string testPara = Server.UrlEncode( lblName.Text.Trim()) ;
Response.Write("<script language='javascript'>");
Response.Write("window.open(url.aspx?name=" +testPara + "','_blank','status=yes,scrollbars=yes,resizable=yes,status=yes,width=610,height=500');");
Response.Write("</script>");
string strUser = Server.UrlDecode(Request.QueryString["name"]);
成功解决了该问题。![](/Emoticons/emrose.gif)
![](/Emoticons/hitwall.gif)
最后解决如下:
首先在传递之前先进行urlEncode编码;
使用的时候在进行urlDecode解码。
string testPara = Server.UrlEncode( lblName.Text.Trim()) ;
Response.Write("<script language='javascript'>");
Response.Write("window.open(url.aspx?name=" +testPara + "','_blank','status=yes,scrollbars=yes,resizable=yes,status=yes,width=610,height=500');");
Response.Write("</script>");
string strUser = Server.UrlDecode(Request.QueryString["name"]);
成功解决了该问题。
![](/Emoticons/emrose.gif)