2

The client-side scripts that are loaded into IE 11 using ASP.NET 4.0 (version 4.0.30319) seem to be incorrect.

Specifically, the bool __nonMSDOMBrowser is incorrectly set to true for IE 11 because of the following code:

var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1);

IE 11 has a changed user agent, so this code no longer works.

I found out the above because of problems we're having with the WebForm_AutoFocus function that is unique to IE 11 and tracing through the code, I noticed that this bool was incorrect.

My question, then, is has Microsoft released an update to ASP.NET (4.0) to support IE 11? Has anyone else run into this problem? In the meantime, we might hack the bool and correct it's value with our own added script, but obviously would prefer not to.

Mohamed Abbas
  • 138
  • 1
  • 11
Mike Oliver
  • 395
  • 1
  • 3
  • 12
  • 1
    it is not a bug but supposed to be like this. take a look somewhat why at my question and solution for something slightly different but still the same type of browser problem: http://stackoverflow.com/questions/19999989/internet-explorer-11-detection-on-server-side . basically, it is NOT a bug but the UA string has changed to be inline with standards now. you probably need to check the browser version, if possible, and or do a Regex on the UA string and get the browser version from that along with the associated user agent being reported (in this case Mozilla I believe) – Ahmed ilyas Dec 13 '13 at 19:40
  • 1
    http://www.hanselman.com/blog/IE10AndIE11AndWindows81AndDoPostBack.aspx – SLaks Dec 13 '13 at 19:40
  • 1
    I understand that IE 11 has a new user agent. However, Microsoft should therefore change its ASP.NET client-side scripts to accommodate this new user agent so that its own scripts run correctly. In the case of IE 11 and WebForm_AutoFocus, it currently executes the non-IE code that scrolls the element into view, which causes layout issues. This seems clearly a bug on Microsoft's side in need of addressing... – Mike Oliver Dec 13 '13 at 19:57
  • Regarding the Oct '13 ASP.NET 4.0 update (2836939) referenced in SLaks link, we have already installed this. This does address the browser sniffing issue of IIS w/r/t IE 11, but doesn't address the issue above, which still seems to be outstanding. – Mike Oliver Dec 13 '13 at 20:16
  • I'm also having layout issues because of this problem – Mohamed Abbas Apr 29 '14 at 08:57
  • I reported a bug to microsoft [Bug link](https://connect.microsoft.com/VisualStudio/feedback/details/863392/webform-javascript-not-correctly-detecting-ie-11) – Mohamed Abbas Apr 29 '14 at 11:11

0 Answers0