Possible Duplicate:
IE: Why does Compatibility View disappear for some websites?

At certain points in the application I am writing, I get a pop up bubble saying "A problem displaying XXX caused Internet Explorer to refresh the webpage using Compatibility View."

This causes the browser to refresh and switch to compatibility view. Other than hunting down what is causing this, is there anyway I can prevent this from happening for users of the site? Is the some meta tag or some such I can put on the page?

alt text

  • 3
    May I recommend you ask on StackOverflow about how to fix your application pages so they do not generate the error that upsets IE8 in the first place? Because the chances are they are probably going to upset other browsers as well. From a served page you can only request IE8 to switch into compatability mode (via a meta header IIRC), but you cannot request not to use compatability mode - so you cannot achieve this without somehow changing the settings of every user that visits your site (or, as said, fixing the pages).
    – DMA57361
    Nov 26 '10 at 11:14
  • This question was answered here... superuser.com/q/215735/20433
    – SgtOJ
    Aug 28 '11 at 15:20

Try added this meta tag to your heading first...
<meta http-equiv="X-UA-Compatible" content="IE=edge" >

If you get an error and it switches then try this one. This will automatically set it in Compatibility View...
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

More information about this tag can be found here...

More information...

The latter of the two examples will put then browser in to Compatibility View from the start. Subsequently, means your site will not need to crash before switching. Also the user should never see the error posted in your screenshot.

This feature, or meta tag, was added for webmasters or developers tp have temporary fix after a new release of Internet Explorer. Therefore the only real fix comes down to programming in such away that prevents this from happening. To explain, you need to either program using latest standards, program around the many limitations of Internet Explorer (8 or older), or use a JavaScript library such as jQuery. That is assuming the error or problem in your code is JavaScript related. If it is, then jQuery is a great solution. It will allow you to program once to allow your scripts/webapps to work nearly prefect or as close as possible with all browsers.

Here are a list of reason a site will switch to Compatibility View: the user has the site listed as a site to always go in to Compatibility View; the site is listed by Microsoft to have better user-experience when render in Compatibility View -- the list is update via Windows Update; the site causes such a big problem the browser switches to Compatibility View -- your case; the site has a meta tag that tell the browser to render the browser like IE7 or IE8 -- a.k.a. Compatibility View.

  • Updated the second half of my answer. Also the meta tags should work.
    – SgtOJ
    Nov 30 '10 at 0:30

Go into to tools, internet options, advanced and deselect "Automatically recover from page layout errors with compatibility view"

  • I was thinking more - something that would prevent this happening for all users of the site, without them having to explicitly enable it ?
    – Dan
    Nov 26 '10 at 10:50
  • Dan: Stop using IE quirks?
    – paradroid
    Nov 26 '10 at 11:00
  • @jason44 Sorry what do you mean? The browser is not in Quirks mode - this jump happens when I.E. 8 is set for the Browser and Document Mode. And this is not something I would want site users to care about.
    – Dan
    Nov 26 '10 at 11:04
  • @Dan: I meant that you are using IE6 quirks in your code, which is making IE jump into Compatibility Mode. Anyway, don't you want your webapp to work properly on all browsers?
    – paradroid
    Nov 26 '10 at 11:10
  • @Dan, why don't you force Quirks Mode then, if you want to write code with IE quirks?
    – paradroid
    Nov 26 '10 at 11:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.