简体   繁体   中英

What in an asp.net web site could prevent an html page opening in quirks mode?

We use IIS8 as our web server. We have an old html page that renders in quirks mode (which is what we want) in ie10 when in a virtual directory. It does not have a tag to force quirks mode. If the page is rendered from within a folder in an asp.net web site it does not render in quirks mode and therefore renders incorectly.

We assume we've changed something in the web site configuration that prevents the page rendering in quirks mode by default. Can anyone suggest what this might be?

To avoid writing an essay on why we're doing what we're doing let me just say that we'd prefer not to have the change the html page to force quirks mode, or change it in any way in fact. It would be much mode convenient to establish what change has caused the page to not render in quirks mode by default and make a change in the application installer to change our customers' web sites automatically.

EDIT: I forgot to mention that in both cases I'm using compatibilty mode.

EDIT 2: We're now targetting .net 4.5 and I've read some stuff online that says that disables quirks mode.

Edit 3: It seems that we switched to 4.5 before this problem became apparent.

Edit 4: The answer is twofold. Prompted by Andrew Morton's comment I did a global search for X-UA-Compatible and found Response.AddHeader("X-UA-Compatible", "IE=edge"); in an Application_BeginRequest handler. However, this predates the problem by several years. It must be that some other change more recentlly combined with this has caused the effect. Anyway, we've spent enough time on this and have decided to add a tag to the html to force quirks mode.

From the IE blog :

IE10's HTML5 quirks mode is used for pages without a DOCTYPE or with a legacy DOCTYPE as defined in HTML5.

That means that the only thing causing Quirks mode is the page itself. If you don't want to change it, you can't force Quirks mode. There is no server side fix for this. It is all client-side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM