MVC application forces IE9 to use older standards

When I tested the new ASP.NET MVC application that I created on another computer, the layout was wrong and seemed weird in IE9. When viewing developer tools, Mode / Standards installed older versions and even compatibility mode. I changed this to IE9 and was fine again.

But then, when I re-opened the site, it set these values โ€‹โ€‹again, are there any defaults for them that save the redefinition, or does my application for some reason cause these values โ€‹โ€‹to change in older versions?

+10
internet-explorer-9 asp.net-mvc
Nov 22 '12 at 20:40
source share
2 answers

There is some mechanism that uses the IE browser family to guess which rendering mode is best. More details about this topic:

X-UA-Compatible is set to IE = edge, but it still does not stop compatibility mode

So, there is a way how to tell which version of IE you are targeting. Put this html tag as the first (really first) in the <head> element after <title>

 <!DOCTYPE html> <html> <head> <title>My Web</title> <meta http-equiv="X-UA-Compatible" content="IE=100" > ... 

the content should be contain="IE=8" , if you are targeting IE 8.0, IE = 100 will work for IE 9.0 ++.

I read that this behavior will not work on the intranet, but my experience is different. The fact is that the <meta> element MUST be the first ! The first means no comment. Nothing but the first, after the name.

For example, I do some server-side research in the code to check which version it is and put the meta related to the browser as the first element

+20
Nov 23 '12 at 7:09
source share

As an additional note, you can save the override of compatibility in the local browser during testing.

From ( http://answers.microsoft.com/en-us/ie/forum/ie9-windows_7/ie9-always-rendering-pages-in-ie7-compatibility/c0177b44-3950-e011-8dfc-68b599b31bf5 ):

Step 1: Allows you to disable the compatibility view and verify.

but. Open Internet Explorer.

b. Press the Alt button on your keyboard. Now click "Tools" in the bar menu.

from. Select Compatibility View Settings.

e. Uncheck to display all websites in the "Compatibility" section. View and close the Compatibility Settings window.

Step 2: Reset settings and check Internet Explorer.

Contact: http://support.microsoft.com/kb/923737 (This article may also be used for Internet Explorer 9)

+8
May 12 '13 at
source share



All Articles