﻿  //This script must exist in <body> and just below the <asp:ScriptManager> tag.
  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();  //the control causing the postback
    pbControl.disabled = true;
  }
  
  function EndRequestHandler(sender, args) {
    pbControl.disabled = false;
    pbControl = null;
  }

  function inputFocus(control, defaultText) {
    if (control.value == defaultText) {
      control.value = "";
      control.className = "";
    }
  }

  function inputBlur(control, defaultText) {
    if (control.value == "") {
      control.value = defaultText;
      control.className = "";
    }
  }