Copy Code code as follows:
<%@ Page language= "C #"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<script runat= "Server" >
void Waitfiveseconds (Object o, EventArgs e)
{
System.Threading.Thread.Sleep (5000);
Label1.Text = DateTime.Now.ToLongTimeString ();
}
</script>
<title>asp.net ajax</title>
<body>
<form id= "Form1" runat= "Server" >
<asp:scriptmanager id= "ScriptManager1" runat= "Server"/>
<asp:updatepanel id= "UpdatePanel1" runat= "Server" >
<ContentTemplate>
<asp:button id= "Button1" runat= "Server" text= "do Something" onclick= "waitfiveseconds"/><br/>
<asp:label id= "Label1" runat= "Server"/>
</ContentTemplate>
</asp:UpdatePanel>
<asp:updateprogress id= "UpdateProgress1" runat= "Server" associatedupdatepanelid= "UpdatePanel1" >
<ProgressTemplate>
<div style= "Position:absolute; left:200px; top:150px; Border:solid 1px black; padding:4px; " >
Loading, please stand by ...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</form>
</body>