Ajax (6) UpdateProgress usage

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.