﻿var prm = Sys.WebForms.PageRequestManager.getInstance();

prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);

function InitializeRequest(sender, args) {

    var progressIndicator = $get('progressIndicator');

    if (progressIndicator)
        progressIndicator.style.visibility = 'visible';
    
    // Get a reference to the element that raised the postback,
    //   and disables it.
    //$get(args._postBackElement.id).disabled = true;
}

function EndRequest(sender, args) {

    var progressIndicator = $get('progressIndicator');

    if (progressIndicator)
        progressIndicator.style.visibility = 'hidden';
    
    // Get a reference to the element that raised the postback
    //   which is completing, and enable it.
    //$get(sender._postBackSettings.sourceElement.id).disabled = false;
}

