In ASP. net ajax Beta2, The UpdateProgress control has been moved from the "value-added" CTP to the ASP. net ajax core. The following two articles about UpdateProgress are basically translated from the official ASP. net ajax website.
Use multiple UpdateProgress controls
By default, the UpdageProgress control displays the update progress information of all UpdatePanel controls on the page. In previous versions of UpdateProgress, we cannot set UpdateProgress to display only updates of a certain UpdatePanel, the UpdateProgress control of the latest version provides the AssociatedUpdatePanelID attribute to specify which UpdatePanel control the UpdateProgress control displays. In the following example, the UpdateProgrss control only displays the UpdatePanel update information.
1. Create a Web page and switch to the design view.
2. Under the AJAX Extensions tab of the toolbox, double-click the ScriptManager control to add it to the page.
3. Double-click the UpdatePanel control to add two UpdatePanel controls to the page.
4. Add a Label and a Button to each UpdatePanel.
5. Set the Text attribute values of the two labels to "Initial Page Rendered" respectively ". There are some problems with the official website)
6. Double-Click each Button control to add a Click event.
7. Add the following code to the Click Event Processing of Buttond. Here, a 3-second delay is created manually and the current time is displayed.
- protectedvoidButton1_Click(objectsender,EventArgse)
- {
- //Introducingdelayfordemonstration.
- System.Threading.Thread.Sleep(3000);
- Label1.Text="Pagerefreshedat"+
- DateTime.Now.ToString();
- }
- protectedvoidButton2_Click(objectsender,EventArgse)
- {
- //Introducingdelayfordemonstration.
- System.Threading.Thread.Sleep(3000);
- Label2.Text="Pagerefreshedat"+
- DateTime.Now.ToString();
- }
8. Switch to the design view.
9. Add the UpdateProgrss control to the first UpdatePanel and add the text Panel1 updating...
10. Add the UpdateProgress control in the second UpdatePanel, Panel2 updating...
11. Save and press Ctrl + F5 to run
12. click the Button in the first UpdatePanel. The progress information is only displayed in the first UpdatePanel.
13. click the Button in the second UpdatePanel. The progress information is only displayed in the second UpdatePanel.
The preceding section describes how to use multiple UpdateProgress controls in ASP. net ajax.
- Use Web Parts in ASP. NET 2.0
- JavaScript and ASP. NET controls Integration
- ASP. NET authentication and authorization
- Introduction to ASP. NET 2.0 Virtual Hosts
- Asp. Net dynamic page Conversion