Overview of the UpdatePanel control in ASP. net ajax Extensions

Source: Internet
Author: User

I. Overview of the UpdatePanel control in ASP. NET AJAX Extensions

UpdatePanel can be used to create a wide range of local update Web applications, which are ASP. net ajax Extensions is a very important control. Its strength is that you do not need to write any client script. You only need to add several UpdatePanel controls and a ScriptManager control on a page to automatically implement local updates. The simple UpdatePanel definition is as follows:

  1. <asp:UpdatePanelIDasp:UpdatePanelID="UpdatePanel1"runat="server"> 
  2. <ContentTemplate> 
  3. <!----> 
  4. </ContentTemplate> 
  5. <Triggers> 
  6. <asp:AsyncPostBackTrigger/> 
  7. <asp:PostBackTrigger/> 
  8. </Triggers> 
  9. </asp:UpdatePanel> 

Ii. How UpdatePanel works

UpdatePanel depends on the ScriptManager Server Control and the client PageRequestManager class Sys. webForms. pageRequestManager, which will be specifically mentioned in later client classes). When the ScriptManager allows partial page updates, it will return it to the server asynchronously, unlike the traditional full-page return method, only the page section contained in UpdatePanel is updated. After the HTML is returned from the server, pageRequestManager replaces the code snippet to be updated by operating the DOM object.

Take a look at the working principle of UpdatePanel provided on the official website:

Iii. ContentTemplate attributes

The Contente Template label defines the content of UpdatePanel, which can contain any ASP. NET element. If you want to use a programming method to control the content in UpdatePanel, you need to use ContenteTemplateContainer.

Iv. ContentTemplateContainer attributes

If you want to use a programming method to set content in UpdatePanel, you need to create an UpdatePanel and add the control to ContentTemplateContainer, instead of adding the control to ContentTemplate. If you want to directly set ContentTemplate, you need to write a custom Template and implement it in the System. web. the interface ITemplate In the UI namespace.

5. Triggers attributes

In ASP. net ajax has two types of Triggers: AsyncPostBackTrigger and PostBackTrigger. AsyncPostBackTrigge is used to specify a server-side control and use the triggered server-side events as the asynchronous update trigger of the UpdatePanel, the property that needs to be set includes the Control ID and the event of the server control. PostBackTrigger is used to specify a Server Control in UpdatePanel. asynchronous sending is not used for the return, it is still a traditional whole-page delivery. This is very different from Atlas. Let's look at a small example. Although both buttons are placed in UpdatePanel, Button2 is still used because it is specified in PostBackTrigger. The above is an overview of the UpdatePanel control in ASP. net ajax Extensions.

  1. Introduction to ASP. NET data access
  2. Processing Process for ASP. NET Runtime
  3. Overview ASP. net mvc and FubuMVC core framework
  4. Processing Methods of ASP. NET framework
  5. Analysis on ASP. NET Security Architecture

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.