user1342164
user1342164

Reputation: 1454

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. Is this something I can do programmatically on the page so the user does not have to do this? TIA

Upvotes: 0

Views: 2473

Answers (1)

bdimag
bdimag

Reputation: 963

You could try adding the X-UA-Compatible META tag. This belongs in your <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. A specific version can be designated or the latest version using the 'IE=edge' value.

You can also add custom HTTP headers in the ASP.NET web.config:

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

Upvotes: 4

Related Questions