Problems asp.net 2.0 in IE10 - internet-explorer-10

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

Related

IE 11 - Is there a way to check then enable / disable enterprise mode?

I am out of wit as how to solve this problem in Javascript or HTML. I have customers currently using web applications built for ie9 and under. These legacy applications do not work well on IE11. IT solutions was to enable enterprises mode. Enterprises mode was designed to avoid "common compatibility problems associated with web apps written and tested on older versions of Internet Explorer".
See: http://www.eightforums.com/tutorials/43972-ie11-enterprise-mode-enable-disable-users.html
Enabling enterprises mode appear to be problematic on web application written using Bootstrap and AngularJS. Ie, responsive does not work at all unless enterprises mode is disabled. Not just AngularJS and Bootstrap but other libraries as well.
The solution that I am looking for is a way to check the status of enterprises mode via javascript, then tell the users to either enable / disable the mode. Better, if it can be turn off / on automatically via JS or HTML attributes.
Snooping in the document.x and window.x objects, I do not see any properties that we would give me an indication that enterprises mode is enable. Any suggestion?
Repro(s):
IE11 > Developer Tool > Console > Type window
IE11 > Developer Tool > Console > Type document
There is no DOM property that indicates that you're running EMIE. The whole idea of EMIE is to emulate IE8 behavior better than the IE8 document mode emulates IE8 behavior. EMIE should only be used in specific cases where it's needed; it should not be used wholesale.
It is possible to detect EMIE in certain cases. If you look carefully at the list of user-agent strings over the last couple of releases, there's a noticeable difference between EMIE on IE11 and the user agent string for IE11 RTM.
However, before you take that as your magic bullet, there are two caveats:
You cannot disable EMIE programmatically. It's a local configuration change only.
The user agent for IE11 is completely different today than it was when IE11 was released. Based on reports from the IE team, the UA string is going to be even more complicated, especially once "IE Spartan" (or whatever they choose to call it") hits the wire.
My recommendation? Create a small launcher page that does a simple feature detection for the web app in question. If you detect features consistent with what's needed for the app, then display a link to launch the app. If feature detection fails to detect IE8, IE11, or whatever version you've targeted, display a warning with a link to more troubleshooting information. Be sure to include a launch link anyway, just in case.
This way, the user has the information they need and you have a lightweight way of handling the issue, one that doesn't require too many updates to the app in question.
Hope this helps...
-- Lance
To my mind the reason of the issue is that IE 11 Enterprise mode emulates IE 8. But bootstrap doesn't support IE 8. To overcome it just use HTML5 shim and Respond.js as described here.
<script src="js/respond.min.js"></script>
<script src="js/html5shiv.min.js"></script>
But without check like <!--[if lt IE 9]> - because it seems that it doesn't work in the enterprise mode.
The better solution would be not just include the mentioned scripts without conditions but find out the appropriate condition instead of < IE 9.
To fix the problem with angularjs just use the following meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
For those who also struggled with this problem. I have submitted a feature request to MS IE Team.
See:
https://connect.microsoft.com/IE/feedback/details/1159543/need-a-way-for-client-side-codes-to-detect-enterprises-mode
My solution is a workaround that involve checking the width of the container div. Enterprises mode do not support responsive.

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

ASP.net Ajax Partial Rendering using UpdatePanel not working in WebKit browsers

I am part of the developer team for a quite a large online system using ASP.NET(4).
Asp.net Ajax completely breaks down for Webkit browsers and we are getting full page postbacks when we should be getting partial only for the UpdatePanels.
I am starting to believe it has something to do with my Application Configuration, mainly for the following reasons.
If I move the ajax enabled controls to a new project they will work as expected for all browsers, including Webkit.
I created a static .aspx file with nothing but an UpdatePanel,ScriptManager and a button making a literal visible on click.
I get no Javascript errors from any browser, and i see an http request for the asp.net-ajax (ScriptResource.axd) in both Firebug and Chrome Developer tools
I tried ye'old safari fix from this highly referenced thread
Edit: After a bit more testing and http sniffing i noticed a major difference between the test application and the actual application. The test application generates 2 additional .axd files which are not generated from the actual application. These WebResource.axd, seem to contain data related to the async postback. However this is only the case for Webkit browsers. The WebResource.axd files are generated for Firefox as i can see them in firebug
What i am asking from the community, is any ideas or suggestions as to what could be the cause of this problem and if i am correct to assume that the problem is probably on the server side
Thanks for any help
The problem was due to a deprecated config file that's used to limit the content that bots/spiders/crawlers receive, which was loading by mistake thanks to our lovely inhouse CMS
In short if u get behavior similar to my case, check your or configs
I was having a similar issue however my problem was with all browsers and not just webkit. I ended up going through and tearing up the web.config file and found out that a line: <xhtmlConformance mode="Legacy"> was preventing webresource.axd from working properly. The fix was to simply remove that line from my web.config file.
For a little more information on xhtmlConformance, visit http://technet.microsoft.com/en-us/librarY/ms228268(v=vs.85).aspx.
If you scroll all the way to the bottom you'll notice it explicitly states that it causes issues with webresource.axd and scriptresource.axd.

Formatblock cross browser compatible alternative

I'm using the jhtmlarea html editor in a webb application.
Now during testing I found out that it doesn't work properly with setting headers (h1-4) since it uses the execcommand with "formatblock".
According to this page this isn't supported by for example IE7 and testing has shown that it also has issues in Safari 3-4.
This is at the end of the development project so I need a solution quite fast. Does anybody have any idea on how to make a crossbrowser compatible solution for setting headers?

How can i test my webpage in different web browsers

I am designing my webpage and testing it in my default browsers that is IE8 and firefox 3.0.
how can i test it with lower version. Is there anything which i can use to test in all versions.
Iam having problem with height setting with different version of IE.
for example my div height is 300px; when i view it in IE8 it looks okay, in IE6 is looks okay but it shows less space in IE7. How can i adjust that.
Any suggestion.
http://www.browsershots.org will deal with whether the layout is as you expect.
If you want to test functionality, then you'll find virtual machines to be your friend.
I trust this Microsoft Expression Web SuperPreview for Windows Internet Explorer
You can use selenium for functional web application testing. It is a great tool..
Try using an application called IETester: http://www.my-debugbar.com/wiki/IETester/HomePage
It's unstable and buggy as hell but you can quickly test your page in IE6, IE7 and IE8 and even IE5.5 so it's worth having it around.
IE10 has a special section in their developer tools called 'Emulation' which lets you select the browser in which you want the page to be tested in.