Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE10 SCRIPT5009: '__doPostBack' is undefined

I am facing a problem on IE10 with ASP.NET controls that requires JavaScript post back[like, link button].

It is properly working on the IE9 version as well as on IE10 Compatibility mode. But on the IE10 standard mode, it is giving below error. SCRIPT5009: '__doPostBack' is undefined

[I have created a demo project with a simple asp:link button that redirects to another page.] IE10_error screen

Tried the solution, but didn't work for me

Can anyone suggest fix for this?

like image 496
CHANDRAHAS Avatar asked Mar 07 '13 14:03

CHANDRAHAS


2 Answers

There is apparently a bug in the browser definition files that shipped with .NET 2.0 and .NET 4. The definition files do not cater for IE10 as a browser version and hence defaults to a default definition which doesn't support JavaScript.

Scott Hanselman has a very detailed writeup about this issue here: http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx

Scott proposes two solutions, with the first one being the recommended one:

1. Machine-wide fix Download and install a hotfix on the server:

  • .Net 4 (http://support.microsoft.com/kb/2600088)
  • .Net 2 (http://support.microsoft.com/kb/2600100, http://support.microsoft.com/kb/2608565)

2. Site-only fix Install the App_BrowsersUpdate package from NuGet into your website to import new ie and firefox browser definitions.

  • .Net 4 (http://nuget.org/List/Packages/App_BrowsersUpdate)
  • .Net 2 (http://nuget.org/List/Packages/App_BrowsersUpdate.net20)
like image 103
Hady Avatar answered Sep 30 '22 19:09

Hady


If you have tried the fix and you are still seeing the error in IE11, updating the .net framework to 4.5 would work.

like image 39
bef Avatar answered Sep 30 '22 18:09

bef