如何在MicrosoftAjaxWebForms

时间:2016-06-08 13:38:46

标签: javascript asp.net asp.net-ajax updatepanel

我正在尝试修改MicrosoftAjaxWebForms.js文件,这是asp.net 4.5的默认ajax文件,ASP.NET AJAX Control Toolkit版本是16.1.0.0

这是一个测试的示例项目:https://github.com/FurkanGozukara/tempSite/

打开项目并转到trialpage.aspx并单击该按钮。您将看到错误

这里是完整的MicrosoftAjaxWebForms.js:http://pastebin.com/pU3rBLKW

如果您需要,它还使用MicrosoftAjax.js中的函数:http://pastebin.com/CPCm9BZy

我想要的是,延迟事件_onFormSubmitCompleted

我尝试过如下,但它不起作用。

MicrosoftAjaxWebForms.js:914 Uncaught TypeError: this._tempCompleted is not a function

它给出了上面的错误

    _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 && a.postBackControlIDsNode && a.updatePanelIDsNode && a.panelsToRefreshNode && 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 < 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 < e; b++) {
        d = a.dataItemNodes[b];
        a.dataItems[d.id] = d.content
    }
    for (b = 0, e = a.dataItemJsonNodes.length; b < 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)
},

我应该如何修改整个javascript或该函数来添加自定义延迟功能?

所以我可以在回发完成后按照我的意愿延迟客户端的客户端更新

此处我的赏金有相关问题:How to defer the update at the client side after async postback in updatepanel

0 个答案:

没有答案