Build your own UpdateProgress panel

just by using the core ASP.NET Ajax extentions beta 1
(this example is taken from the ASP.NET Ajax documentation on page http://ajax.asp.net/docs/ClientReference/Sys.WebForms/PageRequestManagerClass.aspx)

Assuming you have a scriptmanager on your page, an updatepanel and an html DIV-element (named 'myUpdatePanel' with style='visibility:hidden;').  'myUpdatePanel' contains the text/image you want to show when the UpdatePanel is waiting to update itself.

<script type="text/javascript" language="javascript">
 
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
  Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler)

 
function BeginRequestHandler(sender, args)
  {
    ActivateAlertDiv(
'visible', 'myUpdatePanel');
  }

  function EndRequestHandler(sender, args)
  {
    ActivateAlertDiv(
'hidden', 'myUpdatePanel');
  }

  function ActivateAlertDiv(visstring, elem)
  {
   
var adiv = $get(elem);
   
adiv.style.visibility = visstring;
  }
</script>

 

 

你可能感兴趣的:(progress)