Search code examples
c#asp.netupdatepanelinternet-explorer-10microsoft-ajax

UpdatePanel async request hangs when there is a content-length mismatch


I have a family member selection control inside an update panel. When I click one of the family member tabs the update panel does a partial postback and causes other update panels on the page to do a partial postback as well.

My problem is that in IE10, when I click several consecutive family member tabs, I eventually get an alret from Fiddler that the content length is zero, unlike the one reported by the header of the response. This does not happen in Chrome or FF and happens much less often locally, where the response of the server is much quicker.

I imagine this has to do with how IE10 vs. Webkit handles canceled requests, but I have no idea what to do about it.

I searched Google a while, but I might not have the right terminology to find the answer I'm looking for.

Has anyone seen this behavior?


Solution

  • Well it seems like IE10 hangs when there are more than 4 concurrent async postbacks running to the same server. Since each consecutive request renders the last one moot, I just added Javascript to cancel the previous request when a new one is made by clicking any of the tabs.

    The code I attached to the click event of the tabs is as follows:

    function StopCurrentRequest() {
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        if(prm.get_isInAsyncPostBack())
        {
            prm.abortPostBack();
        }
    }