How to fix Document mode restart in IE 9 How to fix Document mode restart in IE 9 asp.net asp.net

How to fix Document mode restart in IE 9


One solution that should always work is to put your X-UA-Compatible in HTTP headers. Also, your <!DOCTYPE> should be specified at the top of your HTML document (<!DOCTYPE html> is the easiest one).

If you put your X-UA-Compatible declaration inside the meta tag you can run into the following problems:

  1. X-UA-Compatible is ignored unless it's present inside the first 4k of you page. If you put it somewhere in the bottom of your head section (or in the body) move it to top. The best place for it is right after encoding and language declarations.
  2. X-UA-Compatible is ignored if it's put inside IE conditional comments. For example:

    <!--[if IE]>    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->

    In this case you should remove conditional comments.

  3. Also, you shouldn't have any text before the doctype declaration. If you've got any HTML comments there, for example, the IE will switch to quirks mode.

  4. Finally, check if you're viewing this site from the intranet. By default Compatibility View is enabled for Intranet sites.

I suggest set X-UA-Compatible header for you page and then see if your site is still switching to quirks mode. In that case you should check your markup and try to fix any HTML validator errors until it's back to Standards Mode.