Fixing the Browser Mode in IE Programmatically

15,385

You've already got the document mode sorted. Does that not solve the problem? It usually does the trick.

The browser mode shouldn't need to come into play, as it doesn't affect the rendering at all; it just changes the UA string, so it shouldn't have any impact on the page layout.... unless there is something in the code that tries to do a browser-specific hack by looking at the UA string.

If you have got something in your code that does that, then that's where the problem is and you should probably fix it. (using the UA string to affect page layout is generally frowned on as a bad practice anyway; there are usually better ways to do it)

If it's Telerik itself that's doing it, then I would imagine they'd have already been forced to find a fix for it (IE10 has been out for a while and they'd have had other users complaining), so you may find that updating to the latest version will solve the problem.

Share:
15,385

Related videos on Youtube

Alaa
Author by

Alaa

Software team lead, Microsoft Certified Professional Developer, MSc. IT (Semantic Computer Vision). Key Skills: Project Management, Enterprise SaaS Development, Quality Assurance, Business Analysis, .NET development, Relational and Graph Databases, Content Management Systems, Knowledge Graphs, Artificial Intelligence, Computer Vision, Machine Learning, and Semantic technologies.

Updated on September 15, 2022

Comments

  • Alaa
    Alaa over 1 year

    I have a website that works in full compatibility on All browsers including IE 7 to 9

    I was shocked when i tried it on IE-10, Too many bugs, and because I have no time to fix this for IE-10 and i am also using third party controls "Telerik", I decided to try a simple solution by turning the Document and the browser mode back to ie9.

    In Developer Tools for IE-10, If i set Manually The Document Mode to IE9 Standards and the Browser Mode to IE9, All the bugs will fly away, I have found a way that forcing the IE-10 to use the Document Mode :

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

    But what about the Browser Mode? is there any way to set its value before rendering?


    Solution : The way i used in this question was correct, however the solution for me was updating the windows in the hosting server, There was many updates, suspected one is: Update for Internet Explorer 8 Compatibility View List for Windows Server 2008 R2 x64 Edition (KB2598845)

    • Spudley
      Spudley about 11 years
      @CedricReichenbach - the correct syntax for "use the best IE available" is content="IE=edge"
    • Alaa
      Alaa
      @CedricReichenbach, I don't want the newest, this website is running perfectly since one year ago, on all IE's but not the latest IE10 and IE10 for windows 8.
    • Rich Bradshaw
      Rich Bradshaw
      By the way, there are far less bugs in IE10 - if things only work in IE9 mode, you are doing something wrong. Try serving your 'normal' version (i.e. what you serve to Chrome/Firefox) to IE10 – things should work.
  • Alaa
    Alaa about 11 years
    Thanks for your answer, UA is for document mode only, In the developer tools if you changed the browser mode to IE 10 compat, OR if the website visitor used tools > compatibility view settings> it will work because setting this will actually make the Browser Mode : IE 10 Compat, in my question i am looking for a way to set the browser by default to be IE 10 Compat, because i can't ask every visitor to add it manually to the compatibility view settings.
  • Alaa
    Alaa about 11 years
    Worked!!!, The website is hosted by a dedicated server operated by Windows Server 2008 R2, I have updated the windows using Microsoft update and the problem disappeared!, Many Windows updates installed, suspected one is: Update for Internet Explorer 8 Compatibility View List for Windows Server 2008 R2 x64 Edition (KB2598845)