VS2010 IE renders different - asp.net

So, I have an application that I test on my VS2010 virtual ASP.NET server, when I open it in IE on my local environment, everything renders fine, but whenever I deploy it to the external server, it starts to screw stuff up in IE (CSS and some jQuery problems). I have the same code everywhere, how is it possible to be rendering it differently? (I test them in the same IE version), everything works fine in other browsers.

It sounds like a compatibility-mode issue. In some cases, IE will jump into compatibility mode unexpectedly. This is often related to browser configuration.
Easiest way to preven this is to add the following meta tag to your HTML code:
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
This will force IE to always use the best available rendering engine, and prevent it jumping into compatibility mode, regardless of the browser config.
Hope that helps.

Related

IE browser automatically changed while page redirection

I have done my project in asp.net with using webmethod concepts. I deployed it in live server. Clients are using windows 8 with IE 11/9. When users used my projects then IE version are changed to IE7. webmethod and json does not support IE 7/8. but when this page open then its automatically IE version changed and display 'JSON object' error. I tried to changed IE default version 9.but its automatically changed IE 7/8. how to change IE default version 9. what is the solution for my problem?
I feel you are talking about the compatibility mode. Try adding following meta tag in your layout page or master page.
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
The X-UA-Compatible meta tag allows web authors to choose what version of Internet Explorer the page should be rendered as.
You can read more about this at https://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx

Is there anyway to force Browser mode to be IE 10 Compatibility View

My Web App has some problem on IE10 if not use compatibility view.
I do some research and found a solution that say i have to use
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
So i try to use it but the problem was still remain.
Document mode was change to IE7 as I wish but Browser mode was not change to Compatibility view.
Is there anyway to force IE10 to use
Browser Mode: IE10 Compatibility View
on my web app?
or Is there any javascript that can do this?
Thank you in advance.
Now i just don't need to force browser compatibility view anymore.
I just found out that my web app problem was cause by .net framework browser definition issue.
More information on this blog:
http://www.ampedupdesigns.com/blog/show?bid=54

ASP.Net Change Browser Mode for IE10

In IE 10, if you check the developer tools, you can see that there are two modes for the browser:
Browser Mode
Document Mode
By adding the tag below:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
One is able to force IE10 to render the page in IE9 document standards.
Is there a way that ASP.Net can force the browser to change the Browser Mode to use IE10 Compatibility View or any version lower?
I have an application that seems to break down with IE10, but trying the app in IE10 Compatibility and IE lower versions Browser mode, the application works perfectly fine.
Appreciate any help.
Update:
Posted screenshot of the browser mode and document mode.
If I added the meta tags above, I get:
Notice that the Document Mode is in IE9 mode as specified in the meta tag.
But my application needs to change the Browser Mode (IE10) to something like IE10 Compatibility Mode or lower. Using the current IE10 mode, breaks the application.
You can force the browser to use the most recent by:
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
If you want to use lower versions, just change the number:
<meta http-equiv="X-UA-Compatible" content="IE=7" />
Will render for IE 7. But you see to know that from the example you posted. Not sure what else you are asking though.
I have an application that seems to break down with IE10, but trying the app in IE10 Compatibility > and IE lower versions Browser mode, the application works perfectly fine.
I am having a similar issue with my app not behaving correctly on IE10. I discovered that my issue is related to the ASP.NET browser definition files not recognizing the latest IE:
[Source: http://support.microsoft.com/kb/2600100 ]
By default, ASP.NET uses sniffing technology for the user agent string
to detect browsers. The browser definition files cover a certain range
of browser versions. However, as the version numbers increase, ASP.NET
might not recognize new versions of a browser by using the user agent
string. In this case, ASP.NET might handle these versions as an
unknown browser.
Links for the hotfixes:
.NET 2.0 SP and .NET 3.5 SP1: http://support.microsoft.com/kb/2600100
.NET 4.0: http://support.microsoft.com/kb/2600088

Chrome Frame not triggering in IE9 on Wordpress

I have installed Chrome Frame and it works on some sites but not on mine. I have the correct code from the Chrome tag site
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<!--[if IE]><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script><![endif]-->
WHAT AM I DOING WRONG?????????
I haven't seen this behaviour before, but I will take a guess:
IE has a config setting which tells it to turn on compatibility mode for local intranet sites (that is, sites on your local network, which would include if you're running your site on your PC for testing). This setting is often defaulted to being switched on, without the user realising it.
The setting triggers IE to override any X-UA-Compatible tags in the site, and always force the site into compatibility mode.
This may be causing it to also override your Chrome Frame mode.
So check your browser settings, and if you have this flag switched on, turn it off and try again.
Bear in mind that if your site is for use on an internal network, then this flag may be set for most or all your users. (and if it's for an external site, then bear in mind that most users won't have Chrome Frame installed!)
Is this meta tag within the 1024 first bytes in the document?

CSS renders differently on web server than on development environment

I have this problem where the web application that I have created in my development environment, displays differently after I upload it to the web server.
I am using the same browser and the same machine to view the pages. The only thing different, is the "server". I am using .net 3.5 and on my development environment the pages are served using the ASP.net Development Server. On the web server, the pages are served using IIS 6.0.
I have only a single CSS file that is contained within the "App_Themes/Default" folder that is used to control all the CSS in my application.
Here are some of the things that don't display the same:
1) I have a collapsible panel control that when expanded is supposed to show on top of all the other page elements. On the dev environment, it behaves correctly. On the web server, the panel slides underneath the other elements.
2) I have my element defined with a background and a certain font size. When displayed on my development environment, the text displays on one line. However, on the web server, the text is wrapped even though the text is the same size. It's as if the containing div is somehow rendered "smaller".
3) The width of buttons that do not have a fixed width (so the width is determined by the button text) is different between the development environment and the web server. The bottons on the server are always wider.
I checked to make sure there are no references to other CSS elements in the machine.config and global web.config on the server and on my development environment.
I know the server is reading from the CSS because in general, it looks similar (same colors, backgrounds, font style, etc). It's just that the sizes seems to be off and the layering of the divs.
Has anyone run in to this problem before? Any ideas of what I could look for?
Looks like you are comparing them in Internet Explorer 8. Microsoft introduced different rendering modes for local and Internet servers so that web developers would break down in tears.
If there’s no X-UA-Compatible value and site is in
Local Intranet security zone, it will be rendered
in EmulateIE7 mode by default.
Add X-UA-Compatible header or META to force full IE8 standards mode.
See also http://sharovatov.wordpress.com/2009/05/18/ie8-rendering-modes-theory-and-practice/
We were having an issue with compatibility modes too, so I ended up just adding:
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
Since I knew it worked fine in IE7, 8, and 9.
I had the same problem in Google Chrome. Apparently media queries get messed up if the page is zoomed in or out. Make sure your zoom level is 100% for both sites.
This at least sounds like that the production server added a xml declaration to the HTML or changed the doctype which caused the page being rendered in non-standards-compliant mode. This is also known as quirks mode, you see this very good back in MSIE. The symptoms which you described are recognizeable as box model bug in MSIE.
Rightclick the pages and check the HTML source. Are they both exactly the same? (including meta tags, xml declaration, whitespace, etc)
If you're FTP'ing from Windows to Linux, please ensure that you're transferring in binary mode to ensure that the whitespace (spaces, linebreaks) remain unchanged. Also ensure that you're saving documents as UTF-8 (or at least ISO-8859-1) and NOT as MS-proprietary encoding such as CP1252.
For those of you that are having this problem in an Intranet site setting the meta tag won't fix the problem if "Display intranet sites in Compatibility View" is checked on (which it is in a lot of cases)
You have to send the HTTP response header at the server level, see here
The CSS that is coming from the server may be a older cached version - try refreshing the page using Ctrl+F5 so it get re-requested.
For me, Internet Explorer's Compatibility View Settings was the issue:
After the check-boxes were un-set, the CSS renders perfectly
We had the same issue, fixed on IE9 & IE11 with this:
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
</head>
Juste add this to your web.config file :
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=8" />
</customHeaders>
</httpProtocol>
</system.webServer>
I had the same issue. Our network uses Win7 with IE11 throughout. For me the solution was to, on my local machine adding "localhost" to the list in IE's compatibility settings > "Websites you've added to compatibility View". IE > Tools > Compatibilty View settings.
BTW our NA has every machine setting IE11 to "Display intranet sites in Compatibility View" automatically checked by a group policy.
This often happens to me when the 'server' version is cached somehow. Refreshing did the trick. Throwing away 'temporary internet files' does it, too.
I just had this problem. I'd changed my style sheet and HTML code. It looked great on locally but didn't work on the server. I found that in Visual Studio the CSS file's "Copy to Output Directory" was set to "Do not copy". So my CSS updates were not getting deployed. Sometimes the problem is just user error.
Can be caused by minification, e.g. on dev machine you have
<span>AAA</span>
<span>BBB</span>
but on remote server it becomes
<span>AAA</span><span>BBB</span>
and a space between them gets lost.
try this,.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

Resources