27

I have a simple HTML5 / ASP.NET website that I started testing in IE10 today since it released for Win7.

This is an intranet site within my organization, and I believe awhile back there was a group policy deployed to enable the Display intranet sites in Compatibility View by default.

The thing I noticed today in testing was that even though I am adding an X-UA-Compatible IE=edge HTTP header (via my web.config), the site is showing in IE as:

Browser Mode: IE10 Compat View
Document Mode: Standards

I believe my HTML is actually OK though, because I can simply uncheck the Display intranet sites in Compatibility View setting and when it reloads, it immediately switches to:

Browser Mode: IE10
Document Mode: Standards

So my question is simply, shouldn't the IE=edge header value override the Display intranet sites in Compatibility View setting?

If not, is there any way I can override it?

RichVel
  • 7,030
  • 6
  • 32
  • 48
kman
  • 2,184
  • 3
  • 23
  • 42
  • 2
    I've discovered that setting x-ua-comaptible:IE=edge or IE=10 still results in the browser mode: IE10 Compat View, and ie sending the ie7 user-agent request header. Does anyone else think this is a bug? – Ed. Mar 13 '13 at 20:25
  • I have the same issue. I set meta tag in page and custom header in web config, did not help. Any solution? – Pavel Jedlicka Nov 07 '13 at 14:48

3 Answers3

12

(I'll put this here because this question ranked higher for my google search, but after more digging I actually found the answer on another SO question: https://stackoverflow.com/a/13287226/1563. I'm not sure if they should be merged (at least not without some question editing))

This is likely happening because IE is set to "Display intranet sites in Compatibility View" (Alt+T | Compatibility View settings)

You can't override this setting using the X-UA-Compatible meta tag but you can by sending the X-UA-Compatible http header:

X-UA-Compatible: IE=edge

Credit goes to Lavinski for finding this

Community
  • 1
  • 1
danseagrave
  • 328
  • 5
  • 12
  • 1
    Not sure how its working for you, but my original question clearly talks about using the http header and how it doesn't work for me. – kman Jun 25 '13 at 00:07
  • 2
    Ah sorry, must have mis-read the question (or confused this question with another I was looking at talking about the meta element). Adding the header to using web.config defiantly worked for me though and I'm in a similar situation "display in compat view" set by group policy and our domain added to the intranet sites list. – danseagrave Jun 26 '13 at 18:50
8

This worked for me, try clearing existing headers before adding the new one or any others.

<httpProtocol>
    <customHeaders>
        <clear />
        <add name="X-UA-Compatible" value="IE=Edge" />
    </customHeaders>
</httpProtocol>
Tony
  • 81
  • 1
  • 1
1

I believe X-UA-Compatible forces document mode while "Compatibility View" turns on both IE7 browser and document mode -> the document mode was actually overridden by X-UA-Compatible.

See Difference between "Browser Mode" and "Document Mode" in Internet Explorer

Community
  • 1
  • 1
duri
  • 14,991
  • 3
  • 44
  • 49