• (转)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>

  • 相关阅读:
    放假归来
    用ObjectSpaces重建IBuySpy的数据访问层
    在SPS中加入自定义WebService
    AnnouncementOSD.xml
    Delphi8 is out !
    ASP.NET PreCompilation and KeepAlive
    ScottGu回答了Whidbey发布的时间问题
    DiskBased Caching in Whidbey, Longhorn…
    AnnouncementRSD.xml
    忙着满足客户的需求...
  • 原文地址:https://www.cnblogs.com/rmhy/p/5922825.html
Copyright © 2020-2023  润新知