我已经使用 aspnet ajax 来显示服务器请求的进度图像。代码:
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
// alert('B');
var elem = args.get_postBackElement();
ActivateAlertDiv('visible', 'AlertDiv', elem.value + ' processing...');
}
function EndRequestHandler(sender, args) {
ActivateAlertDiv('hidden', 'AlertDiv', '');
}
function ActivateAlertDiv(visstring, elem, msg) {
var adiv = $get(elem);
adiv.style.visibility = visstring;
// adiv.innerHTML = msg;
}
BeginRequestHandler 被调用并且进度图像可见但 EndRequestHandler 未被调用。由于此进度图像连续运行。