﻿
  var prm = Sys.WebForms.PageRequestManager.getInstance();
 
  prm.add_initializeRequest(InitializeRequest);
  prm.add_endRequest(EndRequest);
 
  function InitializeRequest(sender, args) 
  {
        $get('wrapper').style.cursor = 'wait'; 
        //document.body.style.cursor = 'wait'; 
    // Get a reference to the element that raised the postback,
        //   and disables it.

        if ($get(args._postBackElement.id) != null) {
            $get(args._postBackElement.id).disabled = true;
        }
  }
 
  function EndRequest(sender, args) 
  {
      $get('wrapper').style.cursor = 'auto';
      //document.body.style.cursor = 'default';

    // Get a reference to the element that raised the postback
      //   which is completing, and enable it.
      if ($get(sender._postBackSettings.sourceElement.id) != null) {
          $get(sender._postBackSettings.sourceElement.id).disabled = false;
      }
}

//OnClientClick="javascript:document.body.style.cursor='wait'; this.style.cursor='wait'; return true;"
