Frage

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

War es hilfreich?

Lösung 2

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.

Andere Tipps

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>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top