首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

asp.net页面跳转至html参数为何显示乱码?该怎么解决

2012-01-02 
asp.net页面跳转至html参数为何显示乱码???web.config设置为:globalizationrequestEncoding GB2312 re

asp.net页面跳转至html参数为何显示乱码???
web.config   设置为:
        <globalization
                        requestEncoding= "GB2312 "
                        responseEncoding= "GB2312 "
      />
Response.Redirect( "htm.html?t=中国人 ");

htm.html?t=%d6%d0%b9%fa%c8%cb
显示均为乱码
htm.html代码:
<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml "   >
<head>
        <meta   content= "text/html;   charset=gb2312 "   http-equiv= "content-type "   />
        <title> 无标题页 </title>
</head>
<body>
<script   language= "javascript "   type= "text/javascript ">
        var   str=window.location.href;  
        var   es=/t=/;  
        es.exec(str);  
        var   Info=RegExp.rightContext;  
        Info   =   unescape(Info);
        document.writeln(Info);  
</script>
</body>
</html>


[解决办法]
好像是有问题,先用下面这个,吃完饭再看看 Response.Write( " <script> window.location.href= 'show.htm?t=中文 '; </script> "); Response.End();
[解决办法]
刚写错了,一下代码经过测试,可以运行

Response.Write( " <script language= 'javascript '> window.location= 'htm.htm?t= '+escape( '中国人 '); </script> ");

热点排行