I am using the Flot plotting library. It seems to work fine in IE8 and IE9 but the problem comes when in IE9 Compatibility View - it does not render any of the graphs. I suspect this is because of the HTML5 canvas
object it uses heavily but I could be wrong. I tried doing the following:
Add:
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
to my HTML<head></head>
tag. I even triedIE=8
andIE=9
and that did not help either. My tag look like this:<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.1EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="X-UA-Compatible" content="IE=8" /> ... </head> <body> ... </body> </html>
Because I was still seeing the problem, I added the following to my Global.asax.cs file:
void Application_End(object sender, EventArgs e) { // Code that runs on application shutdown Response.Headers.Add("X-UA-Compatible", "IE=Edge"); }
I am still facing the problem. The error I get is this:
HTML1202: http://intranetdomain/SampleProj/Default.aspx is running in Compatibility View because 'Display intranet sites in Compatibility View' is checked.
Default.aspx
HTML1113: Document mode restart from IE7 Standards to IE9 Standards
Default.aspx
Is there anyway to over ride this?
EDIT: Checking my response headers, adding that line in Global.asax.cs
did not add them to my headers. I wonder why.
Response Headers:
Key Value
Response HTTP/1.1 200 OK
Cache-Control private
Content-Type text/html; charset=utf-8
Server Microsoft-IIS/7.5
X-AspNet-Version 4.0.30319
X-Powered-By ASP.NET
Date Thu, 27 Oct 2011 20:39:55 GMT
Content-Length 29088
EDIT 2: Apparently, Application_End
was the wrong event. Instead, doing this injected the element into the header:
void Application_BeginRequest(object sender, EventArgs e)
{
Response.Headers.Add("X-UA-Compatible", "IE=Edge");
}
But the problem itself still persists.