Search

ASP.NET user-agent sniffing and IE10 (Internet Explorer 10) by Alkarex

Closed
as Fixed Help for as Fixed

4
0
Sign in
to vote
Type: Bug
ID: 662275
Opened: 4/16/2011 5:02:27 AM
Access Restriction: Public
1
Workaround(s)
4
User(s) can reproduce this bug
Hello,

== Facts ==

- ASP.NET is using user-agent sniffing per default.

- Internet Explorer 10 has a user-agent string not known to .NET 4, as visible in the shipped file "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\ie.browser"
More information on http://blogs.msdn.com/b/ie/archive/2011/04/15/the-ie10-user-agent-string.aspx

- Not surprisingly, IE10 is therefore not recognised by ASP.NET as having e.g. JavaScript and cookies.

== Bug ==

As a consequence, a central function such as __doPostBack() is not emitted properly by ASP.NET for IE10, and every component relying on a post back do not work, such as asp:LinkButton and everything using AutoPostBack.
This is directly visible by comparing the HTML/JavaScript source code sent to IE9 and the one sent to IE10.

== Workaround ==

In the meantime to make it work and to avoid similar issues in the future, I use a file ~\App_Browsers\BrowserFile.browser with the following:

<browsers>
<browser refID="Default">
<capabilities><!-- To avoid wrong detections of e.g. IE10 -->
<capability name="cookies" value="true" />
<capability name="ecmascriptversion" value="3.0" />
</capabilities>
</browser>
</browsers>

== Suggestions ==

- Provide a way to disable user-agent sniffing all together.

- Address the special case of IE10 by shipping an update to .NET.

- When needed, replace user-agent sniffing by feature detection, as advised even by some Microsoft teams
http://blogs.msdn.com/b/ie/archive/2011/04/15/the-ie10-user-agent-string.aspx


Cordially,
Alexandre Alapetite
http://alexandre.alapetite.fr
Details (expand)

Visual Studio/Silverlight/Tooling version

.NET Framework 4

What category (if any) best represents this feedback?

Compatibility

Steps to reproduce

This bug can easily be reproduced by making a blank new Web site (e.g. in Visual Studio 2010), add a asp:LinkButton (for instance) or a component using AutoPostBack, and compare source code sent to IE9 (functional) and to IE10 (not functional).

Product Language

English

Operating System

Windows Server 2008 R2

Operating System Language

English

Actual results

In IE10 (or any other browser not recognised, also in the future), a click on a asp:LinkButton will trigger a JavaScript error ("Script Error encountered", "'__doPostBack' is undefined") and the onclick method will not be invoqued. Same for components using AutoPostBack.

Expected results

In all browsers including IE10, a click on a asp:LinkButton should work (invoke the corresponding onclick method) and not trigger a JavaScript error such as "__doPostBack not defined". Same for components using AutoPostBack.
More generally, there should be a mean of disabling user-agent sniffing in ASP.NET all together.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 11/12/2012 at 1:33 PM
please refer http://support.microsoft.com/kb/2600088 for .NET 4.0
Refer http://support.microsoft.com/kb/2608565 for .Net 3.5
Posted by Jmaxxz on 9/28/2012 at 11:39 AM
The proxy maybe a red herring, I see the issue when I hit a the published version of my app, but not when I am running in the debugger.
Posted by Jmaxxz on 9/28/2012 at 11:37 AM
This is still an issue, I am seeing it while running MVC4 + .NET 4.0. Interestingly now it is only occurring when IE10 is going through a proxy.
Posted by kindbergs.dk on 7/30/2011 at 2:26 AM
Which exact ASP.NET release number/name is it that contain this fix?
When will it be released?
And will it work with .NET 2.0/3.5 websites too, or should we manually change the IIS configuration (or use the .browser-workaround) for all old .NET 2.0/3.5 websites?
Posted by Microsoft on 5/10/2011 at 9:29 AM
Hi,

We have fixed this bug in ASP.NET browser capabilities. The fix will be available in the next release of the ASP.NET runtime.

Thanks,
The ASP.NET Team
Posted by Microsoft on 4/18/2011 at 12:46 AM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by Microsoft on 4/16/2011 at 5:14 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Alkarex on 4/16/2011 at 5:05 AM
In the meantime to circumvent ASP.NET user-agent sniffing and to avoid similar issues in the future, I use a file ~\App_Browsers\BrowserFile.browser with the following:

<browsers>
<browser refID="Default">
<capabilities><!-- To avoid wrong detections of e.g. IE10 -->
<capability name="cookies" value="true" />
<capability name="ecmascriptversion" value="3.0" />
</capabilities>
</browser>
</browsers>

Cordially,
Alexandre Alapetite
http://alexandre.alapetite.fr