How to make IE11 behave like IE8 - internet-explorer-11

My application works fine with IE8 but not in IE11. We are not in condition to make change in code as application code is huge.So i am using following code in the common top level jsp:-
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
but still application view is not same as when we manually run the page in compatible mode.What i have notice is that when i manually run the page in compatible mode document mode is set to 5(Default) but when i am using meta tag document mode is still set to Edge.
Thanks

You can Forcefully Emulate IE11 to behave similar to IE8.Add the below lines of code to your web.config file
<httpProtocol>
<customHeaders>
<clear/>
<add name="X-UA-Compatible" value="IE=EmulateIE8"/>
</customHeaders>
</httpProtocol>

Related

Aurelia with VS2015: Modifications to view not visible to the client

I'm using Aurelia with Visual Studio 2015. I started with the project as an empty ASP.NET 4.6 project. But when I change my view, I don't the see the new html elements on the browser side. It seems like the browser is caching it and not getting the new view from my server.
From the F12 tools window, I see no HTTP traffic going to the server except the fetch to get data from the Web Api service.
What server configuration is necessary to make my code updates visible on the browser?
I disable caching ... In Chrome, F12 and then click the Network tab. Check the "Disable cache" checkbox. Ctrl-F5 to clear and refresh. After that, the network tab shows request going out with HTTP Status 200 response and I see the changes. [BUT WHAT IF: I don't want to use the developer tools to control the caching. I just want the module loader to always get the file from the server?]
By default, IIS allows browsers to cache static content such as html, and image files. To avoid that, you need to disable static content cache in the web config file as follows:
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="DisableCache"/>
</staticContent>
</system.webServer>
</configuration>
UPDATE:
You also need to clear the browser cache because the html files are already cached and therefore the browser will not request them to the server. Once the browser cache is cleared and the configuration in place, you will not experience the problem anymore.

How to set a different user agent for IE10 and IE11

I have a java web application running on Tomcat which works in Internet Explorer 8, and works in Internet Explorer 10 by setting the user agent string to IE8 mode. This web application mostly works in Internet Explorer 11 in IE10 mode via content="IE=10". The web application does not work in IE11 in IE8 mode due to IE11 emulation issues. Edge mode for IE11 does not work. IE10 mode is the only viable option at this stage.
I am looking for a way to set the browser mode for IE10 to emulate IE8, and set IE11 to emulate IE10 in the absence of conditional comments.
We have users with IE8, IE10 and IE11 on Windows 7.
IE10 is currently the dominant browser in use. We are moving to IE11 "soon". No other browsers can be used. Users have no choice of IE version, they will be upgraded over time to IE11.
To answer the question of: "Why set IE=8 mode for IE10 and IE=10 mode for IE11?":
It may be possible to fix some of the web application code so that IE11 works in IE=10 mode. IE11 emulation for IE8 is broken to the point that it is not worth trying to fix. The vendor does not support IE11. The best I can do is set an emulation mode which works for most features and fix the rest where possible.
IE=8 is the UA mode which works for IE8 and IE10. This needs to be kept until IE10 is no longer used.
<meta http-equiv="X-UA-Compatible" content="IE=8" />
The most promising UA setting in IE11 to get this application to work is IE=10. This can not be set directly as it breaks the application for IE10 users. For IE11 alone this is a solution:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
Conditional comments are no longer supported by IE10 and IE11. This means that the following code does not work. It results in IE11 having a document mode of Edge.
<!--[if IE 11]>
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<![endif]-->
A setting of content="IE=8, IE=10" works for IE11 but not IE10.
With Velocity the user agent can be set differently for Internet Explorer 10 and Internet Explorer 11 by scraping the user agent then setting the mode depending on the user agent string. This works for now for Internet Explorer 10.
#if ( $req.getHeader("User-Agent").matches('.*Trident.6.0.*') )
<meta http-equiv="X-UA-Compatible" content="IE=8" />
#else
<meta http-equiv="X-UA-Compatible" content="IE=10" />
#end

Why are my Script Bundles only working on Server

I have deployed my app to my IIS server. The javascript/css seem to work when I browse the webpage from the IIS server (although some of the css seems to not be loading as well). However, when I go to another machine and view the webpage from a client, none of the Javascript seems to be enabled. The links to the scripts are there, and when I type their path into the browser, I am able to retrieve the file (so it's not a permissions issue or a path issue). Yes the browser I am viewing the page from has javascript enabled (it's my dev machine where everything works if I'm working from visual studio).
Can anyone help me figure out what is happening here? Everything works fine in my dev machine.
Edit
Ok I have tried everything I can find on the interwebs. I have tried adding the 'bundle' module, removing then adding (as below), I have tried with and without 'runAllManagedModulesForAllRequests', I have tried enableing and disabling the
<compilation debug="false" targetFramework="4.5" />
Nothing seems to work.
<modules runAllManagedModulesForAllRequests="true">
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
<remove name="BundleModule" />
<add name="BundleModule" type="System.Web.Optimization.BundleModule" />
<!-- any other modules you want to run in MVC e.g. FormsAuthentication, Roles etc. -->
</modules>
I just don't understand why IIS7 would be doing something different when you browse the website locally on the server and another thing when you browse the site on different machine?
Edit 2
Even more baffling. I figured there might be something wrong with bundling (some assembly not loaded correctly who knows) so to test the theory, I commented out all the bundling code on my layout and replaced it with hard coded links to the styles/javascript. Again, it works in development, it works when previewing on the server, but when you go to a client machine, none of the javascript seems to work!!! I've installed it on two different IIS servers now... still same problem!
Edit 3
Unbelievable. It looks like the problem is... drum roll. IE10. I am using integrated authentication so I was only using IE. Until I realised that chrome can prompt/pass credentials as well. So I opened the site from Chrome and no problem! I compared the html from my local version on my dev machine to the html coming from the server, and other than the fact that the URLs have an extra element in the path (the site is deployed to a virtual directory) the html is identical. So for whatever reason, IE has decided that it will not run javascript from my IIS server, but it will from every other website on the internet. I even used fiddler to double check that all of the css/javascript was being fetched and received (they are, even checked the temporary files folder after a clean sweep to see if the css/js was downloaded). So, as usual, IE is a piece of crap causing nothing but headache and misery. Now to figure out how to fix this (my organisation is 80% IE).
So for anyone out there who might run into the same issue and has to work with IE I solved the problem by adding this to my _layout.cshtml:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
What this does is instructs IE to use the latest available rendering engine to process the html (in other words don't try to be smart and guess what my html is built for). So it essentially tells the versions of IE that have 'compatibility mode' to not use it.
For me this works fine because our organization is small and we are usually within one version of the latest release of IE. If the latest version causes issues, I can easy fix and deploy with no harm done. However, this IS NOT optimal for a general purpose website or organization with high numbers of users on a variety of IE browsers.
I came across this problem too.
I found was that Internet Explorer was set to "high" when browsing the internet when using our corporate network. Once I added my site to the trusted sites zone, everything worked.
You can check if your site in the Trusted Sites zone, but going to Internet Options -> Security -> Sites

Problems asp.net 2.0 in IE10

We have a website developed in vs2005 with framework 2.0.
The website works fine in all browsers unless IE10. The response.redirect doesn´t work and some buttons throws javascript errors.
If a force the explorer mode to IE10 compatibility view works fine, but we don´t want to tell all our users to force manually.
Anyone have the same problem?
Thanks a lot and best regards
I solved a similar problem by inserting the App_Browsers map into the root map, containing a browser file BrowserFile.browser with the code:
<browser refID="Default">
<capabilities>
<!-- To avoid wrong detections of e.g. IE10 -->
<capability name="ecmascriptversion" value="3.0" />
</capabilities>
</browser>
Try it:
Open your website in IE10
Tools > Compatibility View Settings >
Click in Add to your domain website >
Close
Reload your website.
It´s worked for me.
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, CSS etc.
Try the fix given in the below link. Worked fine for me.
http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx

Moving from IIS6 to IIS7.5 - Custom Handlers

I am moving a site from IIS6 on one server to IIS7.5 on another.
This site was not writen by me, and from what I can tell, they use custom handlers to get around the AJAX limitations of the day.
I copied the code from the old server to the new (pre-compieled) and everything works except the "AJAX" stuff. There are several calls in the code to ashx files. These calls return .js files. On the old server this works great. Does not work on the new server.
In the web.config file I found the following lines:
<httpHandlers>
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>
For some reason this is not working in IIS7.5
Any suggestions are welcome.
Thank you!
I suspect this could be down to the configuration of the application pool managed pipeline mode. You can easily confirm this by changing the Managed Pipeline Mode for the application pool the site runs under to Classic. If this works and you want to continue to run in Integrated mode then you will need to add a handlers section to the web.config. This is different from the httpHandlers information you noted above.
The new handlers section should be in the system.webServer section. I'm sorry I do not know the exact setting for the item you note but you will need to include the preCondition="integratedMode" if you wish to run in integrated mode.