有人有任何想法吗?
运行以下代码时会出现上述错误:
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();
}
答案 0 :(得分:1)
如果你要使用它,你需要处理RequestCompleted
事件:
function RequestCompleted(sender, args) {
// Do what you need to do here
}
如果您不需要处理该事件,只需从标记中删除此行:
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(RequestCompleted);
答案 1 :(得分:0)
我认为你需要做的就是发出一个像这样的脚本块:
function RequestCompleted(sender, args) {
alert("Finished AJAX");
}