UpdateProgress should be the meaning of "update progress".
How to use:
1. Add a ScriptManager control
2. Add a UpdatePanel Control
3. Add a UpdateProgress control
Set the associatedupdatepanelid of the UpdateProgress control to the ID of the 2nd step UpdatePanel (if there are multiple UpdatePanel on the page, Only the corresponding UpdatePanel associated updateprogress display)
Test example code:
Copy Code code as follows:
<%@ Page language= "C #" autoeventwireup= "true" codefile= "Default.aspx.cs" inherits= "_default"%>
<%@ Register assembly= "AjaxControlToolkit" namespace= "AjaxControlToolkit" tagprefix= "CC1"%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd XHTML 1.1//en" "Http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
<title>untitled page</title>
<style type= "Text/css" >
#UpdatePanel1, #UpdatePanel2, #UpdateProgress1 {
Border-right:gray 1px solid; Border-top:gray 1px solid;
Border-left:gray 1px solid; Border-bottom:gray 1px solid;
}
#UpdatePanel1, #UpdatePanel2 {
width:200px; height:200px; position:relative;
Float:left; margin-left:10px; margin-top:10px;
}
#UpdateProgress3 {
width:200px; Background-color: #FFC080;
bottom:0%; left:0px; Position:absolute;
}
#UpdateProgress2 {
width:200px; Background-color: #FFC080;
bottom:0%; left:0px; Position:absolute;
}
</style>
<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" onclick= "Button1_click1" text= "button"/>
<asp:label id= "Label1" runat= "Server" text= "Show data" ></asp:Label>
<asp:updateprogress id= "UpdateProgress1" runat= "Server" associatedupdatepanelid= "UpdatePanel1" >
<ProgressTemplate>
<div id= "Progress" >
Waiting for the ...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
<asp:updatepanel id= "UpdatePanel2" runat= "Server" >
<ContentTemplate>
<asp:button id= "Button2" runat= "Server" onclick= "Button2_click1" text= "button"/><br/>
<br/>
<asp:label id= "Label2" runat= "Server" text= "Show data" ></asp:Label>
<asp:updateprogress id= "UpdateProgress2" runat= "Server" associatedupdatepanelid= "UpdatePanel2" >
<ProgressTemplate>
Update data ....
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
C # code:
Copy Code code as follows:
Using System;
Using System.Data;
Using System.Configuration;
Using System.Web;
Using System.Web.Security;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Web.UI.WebControls.WebParts;
Using System.Web.UI.HtmlControls;
Using System.Threading;
public partial class _default:system.web.ui.page
{
protected void Page_Load (object sender, EventArgs e)
{
}
protected void Button1_click1 (object sender, EventArgs e)
{
System.Threading.Thread.Sleep (3000);
Label1.Text = "Refresh time:" + DateTime.Now.ToString ();
}
protected void Button2_click1 (object sender, EventArgs e)
{
System.Threading.Thread.Sleep (3000);
Label2.Text = "Refresh time:" + DateTime.Now.ToString ();
}
}
Among them, the CSS in the page code is an example on MSDN. UpdateProgress1 in UpdatePanel1 displays a animated GIF picture
Also to the Big Brother big sister advice.