IE 11 Browser Issues with __doPostBack

Realto619 picture Realto619 · Sep 17, 2013 · Viewed 7.5k times · Source

I'm having the same issue with the new IE 11 on Windows 7 that's described in this article:

Basically, the problem is that there is a bug in the browser definition files in ASP.NET 4.0 so that the __doPostBack function isn't rendered properly by IE 11. I tried applying the fix described in the article above to no avail; most likely due to the fact that it was written for IE 10. To illustrate the problem, I posted the browser rendered source code view for the same exact file: one is from IE 10 and the other is from IE 11.

IE 10:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title></head>
<body>
    <form name="form1" method="post" action="BrowserTest.aspx" id="form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTQ1OTQ0MTYyOWRkhppg54D0Mn30nLC/IZTLGlfBr38aeprB3xTAohhbzJQ=" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}    
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
<script src="/WebResource.axd?d=VkfLtYKVwqSRUzJ5c5unJXsrYfD7JD99cKOnK4EzAlBtmGvv5qOEADPvBEF-Abv4R8XOPCOVzoUKZpOWLoWkLmS5Ko2jc6gP0c0boPwDWlQ1&amp;t=634937341768794884" type="text/javascript"></script>

<div>

    <input type="hidden" name="__PREVIOUSPAGE" id="__PREVIOUSPAGE" value="IrJnCf-ARaAvUp2VObKy5G0fSgiunbCJICjf2oeC8yUbPIidn9rC1G7YJWZJWHRXrSiqArylZSjyapyYzouPdDTljHbP4mz-1oB_2NDwvYM1" />
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgKjhfvoAQKfwImNC7GPbKaBg2kB2yl1LVVULUkU56rARLobB/VGAPlx9gAH" />
</div>
    <div>
        <a href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl02&quot;, &quot;&quot;, false, &quot;&quot;, &quot;/&quot;, false, true))">LinkButton</a>
    </div>
    </form>
</body>
</html>

IE 11:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title></head>
<body>
    <form name="form1" method="post" action="/BrowserTest.aspx" id="form1">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTQ1OTQ0MTYyOWRkhppg54D0Mn30nLC/IZTLGlfBr38aeprB3xTAohhbzJQ=" />
<input type="hidden" name="__PREVIOUSPAGE" id="__PREVIOUSPAGE" value="IrJnCf-ARaAvUp2VObKy5G0fSgiunbCJICjf2oeC8yUbPIidn9rC1G7YJWZJWHRXrSiqArylZSjyapyYzouPdDTljHbP4mz-1oB_2NDwvYM1" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgKjhfvoAQKfwImNC7GPbKaBg2kB2yl1LVVULUkU56rARLobB/VGAPlx9gAH" />
    <div>
        <a href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl02&quot;, &quot;&quot;, false, &quot;&quot;, &quot;/&quot;, false, true))">LinkButton</a>
    </div>
    </form>
</body>
</html>

Has anyone else encountered this problem or does anyone happen to know if a fix has been released by Microsoft? In the fix described in the link at the top of this post, basically a folder is created (App_Browsers) with definition files for FireFox and IE. This was the solution that I tried, in the slim hope that it had been future-proofed to account for this situation as well.

I should also probably add that the server that we're having this problem on is a Windows 2003 box. We also have a 2008 box as our Dev server where this is not an issue. We're planning on updating the production box in the very near future, but probably not before this will become an issue for some of our users. In a similar post, the solution was to upgrade to ASP.NET 4.5, but that's not something that I think we're prepared to do at this point unless that's the only option. In yet another post, apparently there's been a hotfix released for it, but it hasn't been voted up or approved as the accepted answer by the original poster, so that's why I'm going ahead and posting this question in the hopes that someone has a definitive answer.

Answer

Brett picture Brett · Nov 30, 2013

Scott Hanselman has a write up about this here:

http://www.hanselman.com/blog/IE10AndIE11AndWindows81AndDoPostBack.aspx