﻿var pbControl = null;
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(BeginRequestHandler);
prm.add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
    pbControl = args.get_postBackElement();  //get the control causing the postback
    if (pbControl != null) {
        if (pbControl.type == "submit") {
            pbControl.value = "正在执行...";
            pbControl.disabled = true;
        }
        else {
            //pbControl.value = "更新中...";
            pbControl.disabled = true;
        }
    }
}
function EndRequestHandler(sender, args) {
    if (pbControl != null && pbControl.type == "submit") {
        pbControl.disabled = false;
        pbControl = null;
    }
    else {
        pbControl.value = "";
        pbControl.disabled = false;
        pbControl = null;
    }
}
