ASPX page: < HTML xmlns = " Http://www.w3.org/1999/xhtml " >
< Head runat = " Server " >
< Title > No title page </ Title >
< Script Language = " Javascript " Type = " Text/JavaScript " >
<! --
Function cancelasyncpostback (){
VaR PRM = SYS. webforms. pagerequestmanager. getinstance ();
If (PRM. get_isinasyncpostback ()){
PRM. abortpostback ();
}
}
//-->
</Script>
<Style Type="Text/CSS">
# Updatepanel1 {}{
Width: 200px; Height: 100px;
Border: 1px solid gray;
}
# Updateprogress1 {}{
Width: 200px; Background-Color: # ffc080;
Bottom:0%; Left: 0px; position: absolute;
}
</ Style >
</ Head >
< Body >
< Form ID = " Form1 " Runat = " Server " >
< Div >
< Table Style = " Width: 835px; Height: 391px " >
< Tr >
< TD Style = " Width: 100px " >
</ TD >
< TD Style = " Width: 100px " >
</ TD >
< TD Style = " Width: 100px " >
</ TD >
</ Tr >
< Tr >
< TD Style = " Width: 100px " >
</ TD >
< TD Style = " Width: 100px " >
< ASP: scriptmanager ID = " Scriptmanager1 " Runat = " Server " >
</ ASP: scriptmanager >
< ASP: updatepanel ID = " Updatepanel1 " Runat = " Server " >
< Contenttemplate >
< ASP: button ID = " Button1 " Runat = " Server " Onclick = " Button#click " Text = " Button " />
< ASP: Label ID = " Label1 " Runat = " Server " Text = " Page Initialization " > </ ASP: Label >
</ Contenttemplate >
</ ASP: updatepanel >
< ASP: updateprogress ID = " Updateprogress1 " Runat = " Server " >
< Progresstemplate >
Processing Data. Please wait. < BR />
< Input ID = " Input1 " Type = " Button " Value = " Cancel " Onclick = " Cancelasyncpostback () " />
</ Progresstemplate >
</ ASP: updateprogress >
</ TD >
< TD Style = " Width: 100px " >
</ TD >
</ Tr >
< Tr >
< TD Style = " Width: 100px " >
</ TD >
< TD Style = " Width: 100px " >
</ TD >
< TD Style = " Width: 100px " >
</ TD >
</ Tr >
</ Table >
</ Div >
</ Form >
</ Body >
</ Html >
Aspx. CS: Protected Void Button#click ( Object Sender, eventargs E)
{
System. Threading. thread. Sleep ( 3000 ); // Creates a 3-second delay and displays the current time.
Label1.text = " Page refreshed " +
Datetime. Now. tostring ();
}