How to add delay to _onFormSubmitCompleted function inside MicrosoftAjaxWebForms
<p>I am trying to modify MicrosoftAjaxWebForms.js file which is default ajax file of asp.net 4.5 and ASP.NET AJAX Control Toolkit version is 16.1.0.0</p>

<p>Here an example project to test out : <a href="https://github.com/FurkanGozukara/tempSite/" rel="nofollow noreferrer">https://github.com/FurkanGozukara/tempSite/</a></p>

<p>Open project and go to trialpage.aspx and click that button. You will see the error</p>

<p>Here the full MicrosoftAjaxWebForms.js : <a href="http://pastebin.com/pU3rBLKW" rel="nofollow noreferrer">http://pastebin.com/pU3rBLKW</a></p>

<p>It also uses functions from MicrosoftAjax.js if you need that : <a href="http://pastebin.com/CPCm9BZy" rel="nofollow noreferrer">http://pastebin.com/CPCm9BZy</a></p>

<p>What I want is, delaying the event <code>_onFormSubmitCompleted</code></p>

<p>I have tried like below but it doesn't work. </p>

<pre><code>MicrosoftAjaxWebForms.js:914 Uncaught TypeError: this._tempCompleted is not a function
</code></pre>

<p>It gives the error above</p>

<pre><code>    _onFormSubmitCompleted: function (c) {
    console.log("_onFormSubmitCompleted");
    setTimeout(function () {
        this._tempCompleted(c);
    }, 1111);
}, _tempCompleted: function (c) {
    console.log("testcompleted");
    this._processingRequest = true;
    if (c.get_timedOut()) {
        this._endPostBack(this._createPageRequestManagerTimeoutError(), c, null);
        return
    }
    if (c.get_aborted()) {
        this._endPostBack(null, c, null);
        return
    }
    if (!this._request || c.get_webRequest() !== this._request) return;
    if (c.get_statusCode() !== 200) {
        this._endPostBack(this._createPageRequestManagerServerError(c.get_statusCode()), c, null);
        return
    }
    var a = this._parseDelta(c);
    if (!a) return;
    var b, e;
    if (a.asyncPostBackControlIDsNode &amp;&amp; a.postBackControlIDsNode &amp;&amp; a.updatePanelIDsNode &amp;&amp; a.panelsToRefreshNode &amp;&amp; a.childUpdatePanelIDsNode) {
        var r = this._updatePanelIDs,
            n = this._updatePanelClientIDs,
            i = a.childUpdatePanelIDsNode.content,
            p = i.length ? i.split(",") : [],
            m = this._splitNodeIntoArray(a.asyncPostBackControlIDsNode),
            o = this._splitNodeIntoArray(a.postBackControlIDsNode),
            q = this._splitNodeIntoArray(a.updatePanelIDsNode),
            g = this._splitNodeIntoArray(a.panelsToRefreshNode),
            h = a.version4;
        for (b = 0, e = g.length; b &lt; e; b += h ? 2 : 1) {
            var j = (h ? g[b + 1] : "") || this._uniqueIDToClientID(g[b]);
            if (!document.getElementById(j)) {
                this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel, j)), c, a);
                return
            }
        }
        var f = this._processUpdatePanelArrays(q, m, o, h);
        f.oldUpdatePanelIDs = r;
        f.oldUpdatePanelClientIDs = n;
        f.childUpdatePanelIDs = p;
        f.panelsToRefreshIDs = g;
        a.updatePanelData = f
    }
    a.dataItems = {};
    var d;
    for (b = 0, e = a.dataItemNodes.length; b &lt; e; b++) {
        d = a.dataItemNodes[b];
        a.dataItems[d.id] = d.content
    }
    for (b = 0, e = a.dataItemJsonNodes.length; b &lt; e; b++) {
        d = a.dataItemJsonNodes[b];
        a.dataItems[d.id] = Sys.Serialization.JavaScriptSerializer.deserialize(d.content)
    }
    var l = this._get_eventHandlerList().getHandler("pageLoading");
    if (l) l(this, this._getPageLoadingEventArgs(a));
    Sys._ScriptLoader.readLoadedScripts();
    Sys.Application.beginCreateComponents();
    var k = Sys._ScriptLoader.getInstance();
    this._queueScripts(k, a.scriptBlockNodes, true, false);
    this._processingRequest = true;
    k.loadScripts(0, Function.createDelegate(this, Function.createCallback(this._scriptIncludesLoadComplete, a)), Function.createDelegate(this, Function.createCallback(this._scriptIncludesLoadFailed, a)), null)
},
</code></pre>

<p>How should i modify the entire javascript or that function to add a custom delay feature?</p>

<p>So i can delay the client update at the client side as i wish after the postback is completed</p>

<p>Here my bounty having related question : <a href="https://stackoverflow.com/questions/37237675/how-to-defer-the-update-at-the-client-side-after-async-postback-in-updatepanel">How to defer the update at the client side after async postback in updatepanel</a></p>