locked
How to overrde compatibility mode for intranet site when "Display intranet sites in Compatibility View" is checked? RRS feed

  • Question

  • How do you override the compatibility mode for an intranet site if the "Display intranet sites in Compatibility View" is checked?  I am referring to the Browser Mode, not the Document Mode.  Press F12 or select the Tools | Developer Tools menu to see what I mean.  I keep reading that the meta tag will do this, but it doesn't for me.  If the "Display intranet sites in Compatibility View" checkbox is checked, I can't get the Browser Mode to be IE8 no matter what value I set the meta X-UA-Compatible tag to.

    Thanks.
    Pro LINQ: Language Integrated Query in C# 2008 - http://www.linqdev.com - http://www.netsplore.com
    Tuesday, November 10, 2009 7:54 PM

All replies

  • Ditto this problem. Any solutions out there?

    Meta tags do not seem to override the Intranet zone checkbox. If the site is added to "trusted sites," it works, but that would mean changing the setting for all internal users - not feasible.

    The other option is to make sure IE8-compatibility mode and IE7 are rendering properly, and just let the users see what they see.

    Any better ideas?
    • Proposed as answer by tootsee1 Wednesday, November 18, 2009 8:20 PM
    Tuesday, November 17, 2009 4:56 PM
  • Same problem here. There are definite rendering differences.
    Monday, November 23, 2009 4:13 PM
  • Works for me.  For the record, the following tag is what he is referring to:
    http://www.alistapart.com/articles/beyonddoctype/

    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    • Proposed as answer by Code Chief Thursday, February 14, 2013 1:01 PM
    Tuesday, January 26, 2010 12:24 AM
  • You can also set it as a http header, rather than setting it in the HTML of every page. 
    name:  X-UA-Compatible
    value: IE=8

    Tuesday, January 26, 2010 12:32 AM
  • Just in case you hadn't found a solution yet: I ran across this same problem.   The only way I found to override the "Display intranet sites in Compatibility View" setting was by setting the X-UA-Compatible host header for the particular site in IIS to "IE=8".  This overrides the browser setting--but the meta tag does not for some reason.
    • Proposed as answer by JoelMueller Tuesday, April 13, 2010 9:25 PM
    Friday, February 19, 2010 8:01 PM
  • Andy/Ben, unfortunately for me, I didn't want to override the compatibility mode for my entire site, just a few pages.
    Pro LINQ: Language Integrated Query in C# 2008 - http://www.linqdev.com - http://www.netsplore.com
    Wednesday, August 4, 2010 3:14 PM
  • Hi Joe,

    Depending if if you are using Web Forms or MVC:

    Web Forms - Make a Base Page class that inherits from Page and have your code behinds inherit from there on the few pages that have the exception. Add Response.AddHeader

    Response.AddHeader("X-UA-Compatible""IE=8"
    );

    Binding to Page_PreInit or something. Then any page inheriting from that "Page" will have that in the header automatically.

    MVC - If you think its going to happen a lot you could add a controller attribute that adds the correct header on all controller actions with the attribute. If its only a few one off cases you might as well write a static function that you call during the controller action(s) that runs the above code.

    Enjoy!

    John

     

    Friday, March 4, 2011 9:28 PM
  • The solution I found for my ASP.NET MVC 3 app was to add the following to my Global.asax.cs:

     

    protected void Application_EndRequest()
    {
      Response.Headers.Add("X-UA-Compatible", "IE=8");
    }
    
     

     

    This will add the header to every response.  Not bad for one line of code eh?

     

    -Garry

    • Proposed as answer by mattmoeller Wednesday, October 17, 2012 1:39 PM
    Wednesday, August 3, 2011 8:25 PM
  • usfivemusic's answer was most helfpful for me.
    Friday, November 11, 2011 3:46 PM
  • Awesome!!!

    Just a small correction here, if you get error like "Response.Headers.Add causes Requires IIS integrated pipeline mode exception" adding above code then use below code:

    protected void Page_Init(object sender, EventArgs e)
            {
                Context.Response.AddHeader("X-UA-Compatible", "IE=8");
            }

    To summarise, if your requirement is to turn off IE Compatibility mode from .net code behind, use above code in page_init of the page.

    Regards

    Raj


    Raj

    Friday, August 3, 2012 11:46 AM
  • Works for me.  For the record, the following tag is what he is referring to:
    http://www.alistapart.com/articles/beyonddoctype/

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

    Since most web sites should be using some sort of shared layout (MVC) or master page (WebForms) the declarative syntax is better in my opinion. Although you may wish to choose a higher browser standards version.

    Alternatively, there is a third way of configuring this globally, in the web config, documented here:

    http://msdn.microsoft.com/en-us/library/jj676913(v=vs.85).aspx

    Regarding which version to Support, this article has a pretty good suggestion including other non-Microsoft browser versions:

    http://alistapart.com/article/beyonddoctype

    <meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />


    Key Artefacts



    • Edited by Code Chief Thursday, February 14, 2013 1:15 PM
    Thursday, February 14, 2013 1:11 PM