强制浏览器使用兼容模式,Web.config,httpProtocol

  对于一些政府类的网站,很多支持IE6~8,而不支持使用更高版本浏览器浏览。虽然有些浏览器会自动使用兼容模式,或有些人会手动调整浏览器的兼容模式,但不是每一个人、每一款浏览器都可以做到用兼容模式。所以,强制浏览器使用指定版本的兼容模式运行,变得势在必行。

<configuration>
  <system.webServer>
 
    <!-- 设定网站服务器以指定预设兼容性模式 Lionden -->
    <httpProtocol>
      <customHeaders>
        <clear />
        <add name="X-UA-Compatible" value="IE=EmulateIE7" />
      </customHeaders>
    </httpProtocol>
 
  </system.webServer>
 
</configuration>

  微软IIS知识链接:http://www.iis.net/configreference/system.webserver/httpprotocol

posted @ 2016-09-14 23:15  comsky  阅读(1577)  评论(0编辑  收藏  举报