Fix: UpdatePanel Async Postbacks Slow in Internet Explorer

When using Internet Explorer to browse a page that contains an UpdatePanel, there is a delay (often anywhere between 10 seconds and 45 seconds or more) after clicking a page element that initiates an async postback. The delay is not experienced when using browsers other than Internet Explorer.
The PageRequestManager's _destroyTree method iterates through the DOM elements inside of the UpdatePanel prior to initiating an async postback in order to dispose of DOM elements. The _destroyTree method's specific implementation is very slow in Internet Explorer when working with a large DOM tree under some conditions due to the way that Internet Explorer's HTML viewer (mshtml.dll) stores DOM elements in memory.

Add the JavaScript below immediately before the closing </body> element of the page experiencing the delay.

<script language="javascript" type="text/javascript">

      function disposeTree(sender, args) {
        var elements = args.get_panelsUpdating();
        for (var i = elements.length - 1; i >= 0; i--) {
            var element = elements[i];
            var allnodes = element.getElementsByTagName('*'),
                length = allnodes.length;
            var nodes = new Array(length)
            for (var k = 0; k < length; k++) {
                nodes[k] = allnodes[k];
            for (var j = 0, l = nodes.length; j < l; j++) {
                var node = nodes[j];
                if (node.nodeType === 1) {
                    if (node.dispose && typeof (node.dispose) === "function") {
                    else if (node.control && typeof (node.control.dispose) === "function") {

                    var behaviors = node._behaviors;
                    if (behaviors) {
                        behaviors = Array.apply(null, behaviors);
                        for (var k = behaviors.length - 1; k >= 0; k--) {
            element.innerHTML = "";




More Information

This script uses the getElementsByTagName method which is much faster in Internet Explorer than the original implementation.

This problem will be corrected in the next version of ASP.NET.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Article ID: 2000262 - Last Review: 09/11/2009 18:48:00 - Revision: 7.0

Microsoft ASP.NET 3.5

  • KB2000262