任何人有任何想法吗?

当运行以下代码时,会发生上述错误:

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(RequestCompleted);


在此块内:

<script language="javascript" type="text/javascript">
    var postBackElement;

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(RequestCompleted);
    Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(InitializeRequestHandler);

    function InitializeRequestHandler(sender, args) {
        //set the postBackElement
        postBackElement = args.get_postBackElement();
    }

最佳答案

如果要使用RequestCompleted事件,则需要处理它:

function RequestCompleted(sender, args) {
   // Do what you need to do here
}


如果您不需要处理事件,只需从标记中删除此行:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(RequestCompleted);

08-17 13:15