Issues when IE browser mode =11 and document mode=7 - asp.net

I have my application set to document mode=7 through webconfig. When this application is deployed in a windows server 2008 r2, and when i try to access it through internet, the document mode = 7 but my browser mode = 11. Most of the functionalities like sorting of ListView, selected change of checkbox is not working. When i change the browser mode to 7 using IE Explorer, it is functional. How can this be resolved?

You need to either set the X-UA-Compatible META tag like this:
<meta http-equiv="X-UA-Compatible" content="IE=7">
or add a custom header for X-UA-Compatible via IIS, the web.config or in C#:
HttpContext.Response.AddHeader("X-UA-Compatible", "IE-edge");
You can add the custom header in the web.config, see http://www.iis.net/configreference/system.webserver/httpprotocol/customheaders for help.
A word of advice, you need to take the time to upgrade the site to work with modern standards or you are going to lock yourself into a corner. IE 7 is almost a decade old, so consider that.

Related

RadGrid + ASP.NET + IE10 Issue

I've added a RadGrid to an older ASPX and it works fine in Chrome and FireFox. Internet Explorer 10 does not render any of the sprites like the green plus sign for 'Insert new record' or even the funnels for the filter buttons. Clicking the empty space where the image ought to be works: the filter menu appears as does the insert form template appears.
Does anyone have any idea what could be the cause of this?
Some notes:
I have changed the meta tag to IE-9 compatibility with no success.
The console in IE shows an error when calling __defineGetter__. I haven't traced this too far; not sure if it's relevant to my problem.
The RadGrid operates fine, the only issue is that IE10 does not load
the image sprites. I've cleared my cache multiple times and have had
another user test it with the same result.
RadGrid should work out of the box with IE 10. Make sure you're running the latest version of the Telerik controls and clean out IE 10's cache. If that doesn't work I would check with Telerik's support directly...
Maybe the DocType, try:
<!DOCTYPE html>
Make sure compatibility mode is not being used:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Force Browser and Document Mode in ASP.Net Application

IE9+ sometimes have Browser Mode/Document Mode set to earlier versions or set to compatibility mode. This causes issues in my application whereby javascript doesn't run.
Is there a way to force these to be the latest standards or to a particular standard, or is there something in my document in the type or head that can define this?
Yes, totally possible. Just make sure you use the content="IE-Edge" in your Master/layout page. this ensures IE is running on its standard mode. If you want a specific mode, replace it with content="IE9" or content="IE8"
<meta http-equiv="X-UA-Compatible" content="IE=Edge">

CSS not rendered in IE 10

CSS files not rendered in IE 9 and 10 but works good in compatibility mode.
I am the following error get "SEC7113: CSS was ignored due to mime type mismatch" in IE 10 .
wherein i don't get a content-type in my response header!
Further this is on my local.
Any suggestions could be appreciated.
It has an answer, summary would be:
As due to MIME type mismatch css was ignored in IE 9 and 10. The MIME type can be correct by utility called File TypesMan It is freeware created by NirSoft. It turned out that the MIME type of .css had been changed to text/plain, preventing IE from rendering my styles. using FileTypesMan to change it back to text/css fixed the problem.
Download FileTypesMan from the NirSoft site. Use the links near the bottom of the page to select the correct version for your operating system (there are different versions for 32-bit, 64-bit, and Windows 98/ME).
Unzip the files to a local folder, and double-click FileTypesMan.exe.
When FileTypesMan has finished listing all file types, scroll down in the top pane to find .css.
Double-click to edit the settings.
Change the value to text/css in the MIME Type field in the dialog box that opens.
Click OK. Job done.
IE 10 should now behave itself (well, at least as far as rendering style sheets is concerned).
Not my work: Its not my own search, you can see this here: https://stackoverflow.com/a/18791928/1762944
I hope this fixed you!
I was wondering that you are not writing type="text/css" but you said, that you are! So I found this the next helpfull article! It has the same issue as yours. SEC7113: CSS was ignored due to mime type mismatch
I just did a simple Google search for the issue, and this was the first result! You should have searched for the issue.
Please ensure that the CSS file gets delivery with the correct "Content-Type" from the server. It must be "text/css". Use the developer console to determine the current type.
Potentially you need to adjust/create the MIME type mapping (e.g. for httpd).
hth
Try to specify the attribute type="text/css" in your tag. Place your style tag in <head> section.
I was having similar problem with an embedded micro-controller (not a lot of control over the server changing content type). Not sure if this applies but I found going into Settings->Compatibility View Settings and adding the IP (site) address the CSS was accepted and the page rendered properly.

IE 9 BoxModel padding/spacing issue when changing localhost to computername

when I run my site on for example: /localhost/Test then the box-model and table borders/padding/spacing etc... looks normal.
Example IE9 Box Model OK localHost: http://www.flickr.com/photos/cenesam/6243269622/in/photostream
When I run the same test site on: /my computer name/Test then IE9 goes wacky and the box-model increases padding / spacing etc...
Example IE9 BoxModel NOK Computername:
Url: http://www.flickr.com/photos/cenesam/6242752657/in/photostream
Does anyone recognize this behaviour and knows how to deal with this?
I've included 2 sample pictures to show the visual problem. One is with localhost one is with computer name.
Any ideas are much appreciated.
Thanks,
Joost
Finaly found the answer somewhere on the web.
Spudley (thank you!) pointed me to the right direction. This meta tag was definitly the answer!!
But what is important that IE NEEDS this tag to be the FIRST one in the Head section. My site uses a theming engine which parses the styles in the head tag and therefore it was not working.
Now I'm overriding this in web.config (webserver section) by:
<httpProtocol>
<customHeaders>
<remove name="X-UA-Compatible" />
<add name="X-UA-Compatible" value="IE=Edge" />
</customHeaders>
</httpProtocol>
And now it finaly works again.
Thank you all for thinking with me!
Check the developer tools window (press F12) to see what rendering mode is being used.
IE has config settings which can cause it to fall back into compatibility mode in certain circumstances. One of those circumstances is when it's run on a "local intranet site" (which includes localhost).
Go to the IE Tools menu, and pick the "Compatibility View Settings" to change the config on this.
To force the site to load in the correct mode regardless of this setting, you can include the following meta tag in your HTML <head>:
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
Hope that helps.
Have you included an html doctype in the page? Ie9 modifies its behavior depending on the value of the doctype and/or meta tags.
http://www.google.com/search?hl=en&q=ie9+doctype+site%3Amicrosoft.com
Check for the "compatibility view" icon in the URL bar (the "broken page") and look if clicking (i.e. "activating" it) changes something.
Display the menu bar (right-click -> menubar) go to extras -> compatibility view preferences (like this, i got the german version here) and remove the "intranet" checkbox.

Local website renders differently using (IP address or machine name) vs localhost?

I have an MVC3 (razor) site published to IIS7 locally for testing purposes.
When I access the site via "localhost" it looks different from when I access using the IP address or machinename?
I have cleared my cache and re-loaded the pages to confirm and they still appear the different. The CSS must be loading to give the correct fonts/colours etc, although ":hover" elements appear to load much slower?
I am using JQuery/JQueryUI on the site if that helps identify the problem?
Any ideas?
Edit: More info
The titles, labels and table definition are build from ViewBag.Title, or looping through rows in a ViewModel - nothing clever, just standard MVC3/Razor stuff.
The same css file is used for every page, and F12 in IE8 shows the correct css has been loaded.
Title/subtitle font sizes/colours are correct, just their positioning is out?
Table border appears thicker?
Positioning generally seems a little "out", but I can't understand why there is this difference?
Can a firewall/AV package strip out positioning?
The same css file is used for every page, and F12 in IE8 shows the
correct css has been loaded.
Developer Tools should show that IE is not using the same "Browser Mode"/"Document Mode" between the two instances of the site, because that's the problem here. IE defaults to different modes depending on if you're using a machine name or not (amongst other things).
Adding this to your <head> should sort out the problem:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
I had a similar issue, where the sizes differed from the local development site to the one on the production server. Turned out that I forgot the zoom level to 90% when viewing the development version... This answer helped me realize that: https://superuser.com/questions/315448/different-font-size-between-localhost-and-remote-server-in-firefox
I had exactly similar issue in IE11, I used this code
<meta http-equiv="X-UA-Compatible" content="IE=11">
And now whether its localhost or my machine name, the page always rendered nicely.
Just wanted to add, that if you use HTML5 tags (nav, header etc.) IE8 will render different on localhost and remote host.
If you add:
<!--[if lt IE 9]>
<script>
document.createElement('header');
document.createElement('nav');
</script>
<![endif]-->
Then the IE8 will show the same on local and remote host.

Resources