1

Problem: I want to force legacy quirks mode on one of my asp.net pages for IE10. I have tried: <meta http-equiv="X-UA-Compatible" content="IE=5" />

in the head of my page. I have made sure its the first thing to appear after the head element. It does not accept the meta tag in IE10.

I would declare the quirks mode in the web.config file but I only want it for one page not the whole solution. Is there a way to specify it for one page in the web.config?

I have also tried declaring a doctype at the start of my page but that forces it into new quirks mode (source:Does the windows 8 internet explorer 10 still have quirksmode?) and not the legacy quirks mode.

My last, and very last option is to put the page in an iframe - but it would require a lot of work.

EDIT: Working environment - ASP.NET 4.0 IIS 7

Many Thanks

Community
  • 1
  • 1
dannmate
  • 106
  • 3
  • 12
  • A slightly off topic question (or maybe not): wouldn't it be a faster and long-term solution to upgrade the page to the latest standards? – Alex Filipovici Jul 10 '13 at 05:58
  • 1
    Could you post the `DOCTYPE` and `html` tags you are using on the page? – Alex Filipovici Jul 10 '13 at 06:25
  • Alex - It would be, but we are using 3rd party tools then have to render in IE5 quirks mode, which are out of our control. – dannmate Jul 11 '13 at 05:44
  • I also fixed the problem. When the page was rendered, it was rendering HTML markup first before the html and head declarations. I made sure this markup was rendered after (which it always should be) and it accepted the meta tag just fine. – dannmate Jul 11 '13 at 05:47

2 Answers2

0

If you want to enable the IE5 quirks document mode in IE10, adding a DOCTYPE tag together with the meta tag you mentioned should be enough.

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=5" />

You can also move the file to a separate folder and also add the following web.config file in that folder:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
       <httpProtocol> 
           <customHeaders> 
                <clear /> 
                <add name="X-UA-Compatible" value="IE=5" />
           </customHeaders> 
       </httpProtocol> 
    </system.webServer> 
</configuration>
Alex Filipovici
  • 31,789
  • 6
  • 54
  • 78
  • Thanks Alex, good suggestion - but I am trying to steer clear of re-arranging the my solution. – dannmate Jul 09 '13 at 22:59
  • Hi again, I tried your solution and it an Visual Studio gives me an error saying that "The 'content" attribute is not allowed." in the new web.config file. I tried using the 'value' attribute but to no avail. – dannmate Jul 10 '13 at 00:09
  • I know this is old, but for anyone else who finds this, that top block should go at the top of each page (or master page), not in the web config. That's why @danmate is getting an error. – Mike U May 21 '14 at 18:09
  • @MikeU Of course i didnt put html code in the web.config tile..That wasn't the issue. See above what my issue was. – dannmate May 29 '14 at 06:32
  • @danmate Sorry. Maybe I misunderstood what you meant by this line in a previous comment: "'The 'content' attribute is not allowed.' in the new web.config file'. It sounded like you put the meta tag in the web.config. – Mike U Jun 12 '14 at 17:36
0

I also fixed the problem. When the page was rendered, it was rendering HTML markup first before the html and head declarations. I made sure this markup was rendered after (which it always should be) and it accepted the meta tag (stated in the OP) just fine.

dannmate
  • 106
  • 3
  • 12