zoukankan      html  css  js  c++  java
  • (转)web.config 为某个单独页面设置编码格式

    原文链接:http://www.cnblogs.com/mytechblog/articles/1937407.html

    全站应用utf-8格式,在web.config里的<system.web></system.web>节点内插入globalization节点。如下:

    <globalization requestEncoding=”utf-8″ responseEncoding=”utf-8″ fileEncoding=”utf-8″ />


      某个页面要设置gb2312编码格式
      方法是: 在webconfig文件configuration元素下配置以下字节,path 可以目录路径,也可以单独指向某个文件..
    <location path=”Agent/index.aspx”>
    <system.web>
    <globalization fileEncoding=”gb2312″ requestEncoding=”gb2312″ responseEncoding=”gb2312″ culture=”zh-CN”/>
    </system.web>
    </location>


    web.config如下

    <?xml version="1.0" encoding="utf-8"?>

    <configuration>

        <appSettings/>

        <connectionStrings/>

        <system.web>
              <!--all-->
              <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" culture="en-US"/>        
         </system.web>
         <location path="Agent/Index.aspx">
               <system.web>
                   <!--one-->

                   <globalization requestEncoding="gb2312" responseEncoding="gb2312" fileEncoding="gb2312" culture="zh-CN"/>
                </system.web>
          </location>

    </configuration>

  • 相关阅读:
    selenium之css选择器高级用法
    常系数线性齐次递推新理解
    关于莫队本质的理解
    2021.5.8总结
    决策单调性优化dp
    字符串 复习
    5.1总结
    树分块 学习笔记
    莫反 复习
    P4570 [BJWC2011]元素
  • 原文地址:https://www.cnblogs.com/rmhy/p/5922825.html
Copyright © 2011-2022 走看看