You might have a website which was developed many years ago while current Internet Explorer versions were not on the market. Let’s say it works on IE 9. However, when you browse it on IE 11, it has some compatibility issues such as undefined CSS or jQuery classes. In this case, you should tell client IE to render this page with IE 9 engine. But how?
You can add this tag by specifying the IE version you want to be used. There are 3 ways to add it into your project:
- Add a meta tag into your ASPX page
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Put this line right after <head> tag. It’s not recommended to place it under other meta tags because your page will be refreshed when IE engine sees this tag.
- Add it into your web.config
<configuration> <system.webServer> <httpProtocol> <customHeaders> <add name="X-UA-Compatible" value="IE=9" /> </customHeaders> </httpProtocol> </system.webServer> </configuration>
- Add it into your Response object in code-behind (CS file)
Note: If you want your page to be rendered with the latest IE engine available on client side, use IE=egde value instead of IE=9.