Enable Compatibility View (IE8) from code-behind? - asp.net

is there a way that i can add tag in my .aspx page to Enable Compatibility View for Web sites by using Internet Explorer 8 ? without using click on "compatibility" icon on the browser?

Include as the first thing inside <head>:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
I'd strongly recommend fixing whatever site problems you have so the site works properly in IE8-native Standards Mode though. You will get a performance increase from running native in IE8, and even more so in IE9.

You can't actually enable "Compatibility View", but you can use various mechanisms to control the compatibility mode that IE uses to render the page (bobince's suggestion is one). I'd recommend reading: http://msdn.microsoft.com/en-us/library/cc288325%28v=VS.85%29.aspx

Related

What could cause IE10 to block an iframe when running without compatibility view

We're experiencing an issue with our site, YouSIMUL8.com. We use this site to allow people to run simulations on the web. An example simulation can be found at http://www.yousimul8.com/watch.php?x=4d5005d769d31.
If you have a look at what's going with this page, when you press play it loads an iframe in and the simulation is shown there.
I've been speaking to a customer who has been having difficulty using the site. When they open a simulation, only the border of the iframe is shown and nothing else happens. This is using IE10. The problem disappears when compatibility view is turned on.
I cannot replicate this issue with IE10 no matter how hard I try. The customer's IT is outsourced so they cannot access the settings, developer tools or console in IE.
So the question is this: What configuration of the client's machines could cause this behavior?
To force to the rendering of the page to latest version of IE, overriding the automatic compatibility view, try to use the Meta Tag Compatibility View:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Have a look to this StackOverflow post.

ASP.NET page running on compatibility view and displays badly

I'm developing a website that displays fine in FF or Chrome, but when running on IE, it displays the message below and turn view into compatibility, thus the layout fails to display correctly and some tags and controls such asp menu disappear (still exist in html code).
Can anyone help me solve this problem?
Error Message: A problem displaying localhost caused internet explorer to refresh the page using compatibility view!
There are most likely markup validation errors in your page that is causing IE to fall back to compatibility mode that FF or Chrome may ignore. Ensure that your page passes validation.
Try going here W3C Markup Validation Service and running your HTML or URL through to look for any blatant errors.
The other possibility is that you are explicitly setting the meta tag for IE to force compatibility, e.g.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
If so, remove it.

Link Button not working with IE 10

I have an problem related to Link Button Click event in asp.net on Internet Explorer 10.Link Button click event is not firing. It shows the javascript error
SCRIPT5009: '__doPostBack' is undefined
I have Windows Server 2008 Standard Without Hyper-v(6.0, Build 6001) on my system. I tried to fix this problem by Patch provided by Microsoft but that didn't work.I hope you understand my question very well and will give meaningful answer's.
Thanks in advance.
meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9"
meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"
meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"
Problem occurred cause of:
There is a bug in the browser definition files that shipped with .NET 2.0 and .NET 4, namely that they contain definitions for a certain range of browser versions. But the versions for some browsers (like IE 10) aren't within those ranges any more. Therefore, ASP.NET sees them as unknown browsers and defaults to a down-level definition, which has certain inconveniences, like that it does not support features like JavaScript.
I also had same problem,I followed this article, and I'm sorted. Go through below link, It would help for sure.
Fix
Use compatibility meta tags for ie10 which makes your application to run in ie9
i.e.use meta tags for backward compatibility

How can a page in IE render differently between Cassini and IIS7?

I am completely confused - I have a website that renders perfectly in IE8 when run through Cassini (in Visual Studio) but has several messed up elements (style/look) when deployed to localhost and viewed through the same browser (IE8).
I have run Beyond Compare 3 on the html and CSS files and they are exactly the same. Are there any circumstances where IIS7 could be somehow sending extra/different information to the browser? Has anyone run across something like this before?
Note that Chrome and Firefox both render the same webpage just fine through Cassini and IIS7.
(Update)
What Browser Mode and Document Mode does IE8 Developer Tools think you are in if you press F12?
When running from Cassini (http://localhost:22120), IE8 stays in IE8 mode (with the option for turning on IE7 compatibility view) and everything looks great.
When running from IIS7 (http://{machine name}), IE8 automatically goes into in IE8 Compat View, IE7 standards and things look horrible.
My assumption (as mentioned in my comment earlier) was that IE is working in a different rendering mode, depending on whether you are using IIS or Cassini, and this is causing the layout differences. It actually appears to be IE that is causing this, based on the settings found in Tools | Compatibility View Settings. There are two check boxes:
Display intranet sites in Compatibility View - this is checked by default.
Display all websites in Compatibility View - this is not.
Either way, you should use the standard meta tag to force the mode you wish to be rendered in.
<meta http-equiv="X-UA-Compatible" content="IE=8" />
Hope this helps.
I think the best solution I have found is not far from Paul's one but it tells the browser to use your Internet Explorer version which solved other problems I have with content="IE=8".
Here it is:
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
Actually I had the same issue. IE8 has a compatability settings dialog under tools menu. There is a check box which indicates "Display intranet sites in compatability mode".
And not that IE7 compatability mode is not the same as using ie7, there are some differences.
One side note to this issue:
if the same page renders differently on different servers but in the same IE8 browser, check your url - IE8 automatically displays in compatibility mode if the domain is not fully qualified.
If the page content is the same then compare the headers that the servers are sending with the page.
After kicking this around a bit I though about compatibility mode. Try manually forcing IE8 to render the page in compatibility mod. If the render doesn't change then you know that the issue is because IE is rendering that page in compatibility mode when reading it from that web server.
If the latter is the case look into http://msdn.microsoft.com/en-us/library/dd567845%28VS.85%29.aspx

IE8, compatibility view on local files?

I just developed a small website and tested it locally in IE8, there is no compatibility view button but under settings i find an option called "display intranet sites in compatibility view", this option is checked so i trust that all local files are rendered as IE7.
I then upload the page to my server and everything works fine in IE8-mode, now the the comp-view button is visible, i click it and my design becomes fubar!
I go to the settings for comp-view and uncheck the "display intranet sites in compatibility view", the site still looks ok when i try to browse it directly from the hdd and there is still no comp-view button visible.
This time i managed to create a fix in my css quite easily but i don't want to experience this again for a larger website.
How can i get BOTH IE8-mode and compatibility view for local pages and can i trust that it is active or not?
If you load files off your C:\ (e.g. that kind of local) then yes, you are forced into IE8 standards mode. In this case, the only way to toggle it is to use the Developer Tools F12 and toggle it there, by doing the following:
Press F12 to access the Developer Tools. A new pane will appear at the bottom of the browser window
On the left menu, scroll down to the final option (Emulation). Or, press Ctl+8
Set the Document Mode to the desired browser version.
If by local you mean off a webserver running on your PC or on a PC in your network (e.g. Intranet) then you can add it/them to the list of sites... they will then provide the icon on the address bar to toggle it.
I presume based on your description that you are seeing significant changes thus I presume you have set a DOCTYPE. Can you verify this for us?
I use this Meta Tag in IE8 to emulate IE7. If there is a Quirksmode Doctype, then this tag will not work.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
You can Use the *+html CSS hack under IE8.
Instead of checking the "Display intranet sites in compat" try checking the "display ALL sites in compat". Thats what I usually do and it seems to work ok.

Resources