ASP.NET App - Set IE7-Compatibility Mode?

不羁的心 提交于 2019-12-10 14:52:28

问题


What is the simpliest way to set the IE7-Compatibility Mode mode in an ASP.NET application to deal with IE8 issues? Is it possible to set this via the web.config or must it either be set at the IIS or page level?


回答1:


Add the header

X-UA-Compatible: IE=EmulateIE7

in the HTTP Headers tab of the site or application properties in IIS manager. In IIS7 its the HTTP Response Headers feature.

You can place it the <system.webServer> section of a web.config

   <httpProtocol>
        <customHeaders>
            <add name="X-UA-Compatible" value="IE=EmultateIE7" />
        </customHeaders>
    </httpProtocol>



回答2:


If the solution posted here did not work for you, see my question and answer here ASP.NET Ignores IE7 Compatibility Mode Tag in Web.config




回答3:


You can use META tags to influence IE8 to set its mode accordingly:

http://weblogs.asp.net/fredriknormen/archive/2009/03/19/change-ie8-to-ie7-compatible-mode-with-meta-tags.aspx




回答4:


Instead of value="IE=EmultateIE7"

Replace with value="IE=EmulateIE7"



来源:https://stackoverflow.com/questions/713581/asp-net-app-set-ie7-compatibility-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!