1

We have been developing ASP.NET MVC 3.0(Razor & HTML 5) application with IIS 7.5. The site should run on IE8.

The site content displays properly when the comaptibility mode is OFF. But, if it runs with compatibility mode on then the few elements goes outside horizontally.

As the company's IE policy, all the intranet application runs under the "Compatibility Mode" hence I can't change that part.

What should be possible solution? 1. Is there any way when the application url gets renedered, I explicitly instruct browser to not run under compatibility mode (programmatically)? 2. Is there any ways in IIS 7.5 to enforce rendering targeting IE 8.0+? 3. Do I need to target to HTML 4.0 and convert all the fuzzy css/html targeting older html version?

I am seriously out of idea. It may possible the above direction points are also logic-less.

Please suggest somthing on this.

StartingFromScratch
  • 628
  • 3
  • 10
  • 23

2 Answers2

3

You'll need to set the X-UA-Compatible header. You can do in at least two ways:

Add the following to every page:

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

Or you can tell IIS to send it with every response following these instructions to set custom headers to every response.

For a list of values you can use X-UA-Compatible look at this page.

bloudraak
  • 5,902
  • 5
  • 37
  • 52
1

Add this <meta> tag inside <head>:

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

This should force IE to use the most up-to-date rendering engine available.

thirtydot
  • 224,678
  • 48
  • 389
  • 349