UpdateProgress is a progress display bar, which can be more user-friendly in AJAX (I personally think ). Now let's start:
1. Create an AJAX project. Add ScriptManager, UpdatePanel, and UpdateProgress to the page, and add a Label and Button to UpdatePanel.
Second, set the AssociatedUpdatePanelID of UpdateProgress to UpdatePanel1. The complete HTML code is as follows: <% @ Register
Assembly = "AjaxControlToolkit"
Namespace = "AjaxControlToolkit"
TagPrefix = "ajaxToolkit" %>
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> No title page </title>
</Head>
<Body>
<Form id = "form1" runat = "server">
<Div>
<Asp: ScriptManager ID = "ScriptManager1" runat = "server">
</Asp: ScriptManager>
</Div>
<Asp: UpdatePanel ID = "UpdatePanel1" runat = "server">
<ContentTemplate>
& Nbsp; <asp: Label ID = "Label1" runat = "server" Text = "Label" Width = "166px"> </asp: Label> & nbsp;
<Br/>
& Nbsp;
<Asp: Button ID = "Button1" runat = "server" OnClick = "button#click" Text = "Button"/>
</ContentTemplate>
</Asp: UpdatePanel>
<Asp: UpdateProgress ID = "testUp" runat = server AssociatedUpdatePanelID = "UpdatePanel1">
<ProgressTemplate>
Progressing ..
</ProgressTemplate>
</Asp: UpdateProgress>
</Form>
</Body>
</Html>
Third, add a click event to the BUTTON. The Code is as follows: System. Threading. Thread. Sleep (5000 );
Label1.Text = DateTime. Now. ToString ();
It is mainly intended to create a delay and display the effect.
Finally, the operation is OK.