Disable Internet Explorer compatibility view via web.config

Reading time ~1 minute

New Internet Explorers have a necessary (?) but annoying feature called “Compatibility view”. I do not need that in my sites since I try to keep my HTML in good shape. Therefore on all projects I want to disable the feature since usually it breaks the layout. Disabling compatibility view can be done by adding a meta tag to HTML head:

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

…or, as it turns out, by adding a custom HTTP header with the same content. This HTTP-header-way is much better for me as I can include it in my default web.config changes I use on almost every web project.

<system.webserver>
  <httpProtocol>
    <customHeaders>
      <!-- No need to expose the platform -->
      <remove 
        name="X-Powered-By" />
      <!-- Do not show IE compatibility view -->
      <remove 
        name="X-UA-Compatible"/>
      <add 
        name="X-UA-Compatible" 
        value="IE=edge"/>
    </customHeaders>
  </httpProtocol>

Update 4.2.2014

Check my newer post for better solution that covers more IE versions.

Using Protocol buffers v3 with ASP.NET core

This blog post gives a working Input and Output formatters for ASP.NET MVC to work with Google Protocol Buffers. Continue reading

Don't let techies design game user experience

Published on February 02, 2016

Using VS Team Services with go get

Published on January 19, 2016