2

I have a page that works great on localhost, however when I push it out to our staging servers and load it up in IE8, it looks like garbage. Even more so than pages usually look in IE. I've traced this down to the fact that the page is rendering in compatibility mode. If I hit F12, I see:

enter image description here

If I go click on Browser Mode and manually change that to Internet Explorer 8, the page is reloaded in its beautiful mediocrity. However, I can't ask all the users to mess with the Developer Tools.

Is there a way to force the page to render in IE8 Standards Mode? My DOCTYPE looks like:

<!doctype html>

And the HTTP headers in the response are:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 26 Feb 2013 21:56:29 GMT
Content-Length: 6249

Any ideas?

Update: My Compatibility View Settings are as follows, but note I can't ask users to change settings to use our site.

enter image description here

Mike Christensen
  • 88,082
  • 50
  • 208
  • 326

1 Answers1

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

Basically it (Internet explorer) is waiting for you to tell it that you've checked it with new versions of IE. Once you have you give it the seal of approval above and it will assume that the page is safe to render in with IE 8 mode.

Colton
  • 645
  • 4
  • 24
  • Also I suppose because that's an http-equiv tag you could add a header with equivalent name and content and should yield equivalent results. I found it easier to add that tag to the master page file. – Colton Feb 26 '13 at 22:12
  • Wouldn't that force IE8 mode in IE >8? – isherwood Feb 26 '13 at 22:13
  • Excellent! That did the trick. I figured it was a *doctype* setting, but I couldn't seem to find it in the MSDN docs. – Mike Christensen Feb 26 '13 at 22:14
  • It will affect IE9+ badly. See here: http://stackoverflow.com/questions/10445781/using-meta-http-equiv-x-ua-compatible-content-ie-8-mode-in-sites-good-pr – isherwood Feb 26 '13 at 22:15
  • @isherwood - I'm open to other solutions. However, this one works. – Mike Christensen Feb 26 '13 at 22:18
  • It does in IE8. Have you tried IE9 or 10? It may not be pretty. – isherwood Feb 26 '13 at 22:20
  • @isherwood - Right now, 100% of our users are on IE8. So yea, if we upgrade (probably months out if ever) we'll need to retest everything anyway. – Mike Christensen Feb 26 '13 at 22:25
  • @isherwood the answer you linked to is obviously incorrect to some point. It indicates that the tag will have no affect on IE=8 but rather only forces the browser to render *older* versions if provided. This is incorrect as shown by op's case. If the OP would like to mitigate this my understanding is they can use IE=edge to use the latest version. Additionally if the site is tested in IE8 and renders correctly then using new features of IE9 without sufficient testing could be detrimental while using only IE8 will ensure that your site is always sufficient – Colton Feb 27 '13 at 15:18