_doPostback dotnet4.0 error for ie10 and above

First let us show you the bug which occurs if you have frameworks up to dot-net framework 4.0 or I would rather say 4.5 is not present.

Steps to reproduce - 
you have link button on the page and some LinkButton_Click Server side code Written on it

you click it and see

_doPostback is Undefined --- this is under IE10 and IE 11

you happen to choose some other browser and it works fine .You are like really I have used LinkButton whole of my life ...since my kindergarten days ,I bet I can't do anything wrong atleast with my link button skills ....

The problem at least at the writing of this article is very well known and much talked about...

You get the solution on many of the websites or links here or From Dot net GURU

I am not taking about machine wide change ,which can be done by installing certain updates mentioned under 2nd link...I am talking about project specific change ,which can be done manually and appended under App_Browsers folder of you project

what you got to do is get i.e.Browser file from
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers  --- ie.browser

make a second copy and edit the file and paste the following

<browser id="IE11Preview" parentID="Mozilla">
    <identification>
      <userAgent match="Trident/(?'layoutVersion'\d+).*rv:(?'revision'(?'major'\d+)(\.(?'minor'\d+)?))" />
      <userAgent nonMatch="MSIE" />
    </identification>

    <capabilities>
      <capability name="browser"              value="IE" />
      <capability name="layoutEngine"         value="Trident" />
      <capability name="layoutEngineVersion"  value="${layoutVersion}" />
      <capability name="isColor"              value="true" />
      <capability name="screenBitDepth"       value="8" />
      <capability name="ecmascriptversion"    value="3.0" />
      <capability name="jscriptversion"       value="6.0" />
      <capability name="javascript"           value="true" />
      <capability name="javascriptversion"    value="1.5" />
      <capability name="w3cdomversion"        value="1.0" />
      <capability name="ExchangeOmaSupported" value="true" />
      <capability name="activexcontrols"      value="true" />
      <capability name="backgroundsounds"     value="true" />
      <capability name="cookies"              value="true" />
      <capability name="frames"               value="true" />
      <capability name="javaapplets"          value="true" />
      <capability name="supportsCallback"     value="true" />
      <capability name="supportsFileUpload"   value="true" />
      <capability name="supportsMultilineTextBoxDisplay" value="true" />
      <capability name="supportsMaintainScrollPositionOnPostback" value="true" />
      <capability name="supportsVCard"        value="true" />
      <capability name="supportsXmlHttp"      value="true" />
      <capability name="tables"               value="true" />
      <capability name="supportsAccessKeyAttribute"    value="true" />
      <capability name="tagwriter"            value="System.Web.UI.HtmlTextWriter" />
      <capability name="vbscript"             value="true" />
      <capability name="revmajor"             value="${major}" />
      <capability name="revminor"             value="${minor}" />
    </capabilities>
  </browser>

under browsers tag.


paste this file under your project\App_Browsers folder

and rebuild you project.


If you are dealing with Live scenarios make sure you clean up the temporary files from
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files




No comments:

Post a Comment