简体   繁体   English

IE浏览器中的asp.net网页强制文档模式边缘吗?

[英]Asp.net web page force document mode edge in IE?

I have a webpage that is not working properly in IE unless I hit F12 and change the document mode to "Edge" under emulation. 我有一个网页无法在IE中正常工作,除非我按F12键并在仿真下将文档模式更改为“边缘”。 Is this something I can do programmatically on the page so the user does not have to do this? 这是我可以在页面上以编程方式执行的操作,因此用户不必这样做吗? TIA TIA

You could try adding the X-UA-Compatible META tag. 您可以尝试添加X-UA-Compatible META标签。 This belongs in your <head> 这属于您的<head>

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

Internet Explorer allows you to define which version's engine is used to render a page using the X-UA-Compatible META tag or HTTP header. Internet Explorer允许您使用X-UA兼容的META标记或HTTP标头定义使用哪个版本的引擎呈现页面。 A specific version can be designated or the latest version using the 'IE=edge' value. 可以使用“ IE = edge”值指定特定版本或最新版本。

You can also add custom HTTP headers in the ASP.NET web.config: 您还可以在ASP.NET web.config中添加自定义HTTP标头:

<configuration> 
   <system.webServer> 
      <httpProtocol> 
         <customHeaders> 
            <add name="X-UA-Compatible" value="IE=edge" /> 
         </customHeaders> 
      </httpProtocol> 
   </system.webServer> 
</configuration>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM