I'm investigating why a windows modal dialog does not get IE 7 compatibility setting from Web.Config file.
We currently have the following code in Web.Config:
<httpProtocol>
<customHeaders>
<!-- This forces IE7 compatibility for all pages -->
<add name="X-UA-Compatible" value="IE=EmulateIE7"/>
</customHeaders>
</httpProtocol>
This works fine for most pages except for my modal dialog. This modal dialog basically lives within another .aspx file. You can think of this as exampleWebPage.aspx. My modal dialog is found in exampleModalDialog.aspx
This is how the modal dialog is invoked from exampleWebPage.aspx:
var returnvalue = OpenModal("../exampleLocation/exampleModalDialog.aspx",
"dialogWidth:1024px;dialogHeight:740px,center:yes;help:no;status:no;resizable:no;scroll:no;");
After further digging around, I found that OpenModal()
is our own function which eventually calls window.showModalDialog()
which has issues from what I found on the web.
When I press F12 in IE 11 for exampleWebPage.aspx page, I see that the document mode is IE 7.
However, when I press F12 again after opening the modal dialog in IE11, I get the following: Browser Mode: IE 11 Document Mode: IE 5 quirks
I have read this SO post: Force IE8 Into IE7 Compatiblity Mode
What I have tried so far to fix this is going into exampleModalDialog.aspx
and adding the following code after the header tag.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
So that it looks like this:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="..." content="..."/>
Unfortunately, this did not work. Any suggestions?