Monday, June 29, 2015

Adding 'meta' tag in ASP.NET to ensure browser compatibility

Meta tag is very useful to solve most of the browser compatibility issues. If its is html, we need to add it in each page. But in ASP.NET we can straight away add it in Web.config file that will be applied to all the pages. Here is how,

Just add the below config in ASP.NET Web.config file.
<system.webServer>
 <httpProtocol>
  <customHeaders>
   <clear/>
   <add name="X-UA-Compatible" value="IE=9; IE=8; IE=7; IE=EDGE"/>
  </customHeaders>
 </httpProtocol>
</system.webServer>

Below is some of the rendering modes we can use,

ValueRendering mode
IE=9Use the Windows Internet Explorer 9 standards rendering mode
IE=8Use the Internet Explorer 8 standards rendering mode
IE=7Use the Windows Internet Explorer 7 standards rendering mode
IE=5Use the Microsoft Internet Explorer 5 standards rendering mode

No comments:

Post a Comment