最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

asp.net中url字符串編碼亂碼的原因與解決方法

 更新時(shí)間:2013年08月14日 10:03:17   作者:  
這篇文章來(lái)給大家總結(jié)一下關(guān)于asp.net中url字符串編碼亂碼的原因與解決方法,有需要了解的朋友可以參考一下

先看實(shí)例

復(fù)制代碼 代碼如下:

 function webChart() {
            var t = document.getElementById("txtReceive");
            if (t.value == null || t.value == "") {
                alert("請(qǐng)先進(jìn)行查詢");
            }
            else {

                alert(t.value);
                document.getElementById("center-iframe").src = "map/industryMap.aspx?_indeustry=" + t.value;
}}



這個(gè)時(shí)候alert出來(lái)的編碼很正常,都是漢字。

但是在后臺(tái)獲取時(shí)已經(jīng)亂碼

復(fù)制代碼 代碼如下:

        protected void Page_Load(object sender, EventArgs e)
        {
            Industry = Request.QueryString["_indeustry"].ToString();

            InitMap();
            getShowMuilt();
        }

web.config已經(jīng)配置為UTF-8 但是還是不行

復(fù)制代碼 代碼如下:

<system.web>
    <globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8"
                   responseEncoding="UTF-8" fileEncoding="UTF-8" />
  </system.web>



最終解決方案

復(fù)制代碼 代碼如下:

 function webChart() {
            var t = document.getElementById("txtReceive");
            if (t.value == null || t.value == "") {
                alert("請(qǐng)先進(jìn)行查詢");
            }
            else {
                var url = encodeURI("map/industryMap.aspx?_indeustry=" + t.value);
                alert(url);
                document.getElementById("center-iframe").src = url;
}
}

相關(guān)文章

最新評(píng)論

西充县| 友谊县| 青河县| 萍乡市| 台东县| 清丰县| 承德市| 黄石市| 中卫市| 鹤岗市| 隆回县| 定边县| 宣武区| 安顺市| 葵青区| 安丘市| 东丽区| 江阴市| 竹山县| 比如县| 庄浪县| 时尚| 盖州市| 垦利县| 黔南| 内丘县| 孙吴县| 天长市| 浦城县| 齐齐哈尔市| 金溪县| 弥勒县| 达孜县| 富宁县| 曲松县| 布拖县| 三门峡市| 清远市| 电白县| 南乐县| 兴化市|