asp.net Ajax Primer Series (4): Using the UpdatePanel control (i)

Source: Internet
Author: User

UpdatePanel can be used to create a rich local update Web application, a very important control in the ASP.net 2.0 AJAX extensions, which is powerful in that no client script is written, You can automatically implement local updates as long as you add several UpdatePanel controls and a ScriptManager control to one page. Through this article to learn about UpdatePanel simple use method (first article).

A UpdatePanel Control Overview

UpdatePanel can be used to create a rich local update Web application, a very important control in the ASP.net 2.0 AJAX extensions, which is powerful in that no client script is written, You can automatically implement local updates as long as you add several UpdatePanel controls and a ScriptManager control to one page. Through this article to learn about the UpdatePanel work principle and use method. The simple UpdatePanel definition is as follows:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<!---->
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger />
<asp:PostBackTrigger />
</Triggers>
</asp:UpdatePanel>

The important attributes of UpdatePanel are as follows:

Childrenastriggers

If the UpdateMode property is conditional, the asynchronous loopback of the child controls in the UpdatePanel raises the Updatepanle update.

Rendermode

Represents the HTML element that UpdatePanel the final rendering. Block (default) indicates <div>,inline <span>

UpdateMode

Represents the update mode for UpdatePanel, with two options: Always and conditional. Always whether or not trigger, the other controls will update the updatepanel,conditional to represent only the trigger of the current UpdatePanel, Or the Childrenastriggers property is true, the asynchronous loopback or full-page loopback that is thrown by the control in the current UpdatePanel, or the server-side call to update () method, raises the update of the UpdatePanel.

Two UpdatePanel Working principle

UpdatePanel's work relies on ScriptManager server-side controls (asp.net Ajax Primer Series (2): Using the ScriptManager control) and the Client PageRequestManager class (Sys.WebForms.PageRequestManager, which is specifically mentioned in a later client Class), when the page is allowed in ScriptManager When locally updated, it is passed back to the server asynchronously, and unlike the traditional full-page return method, only the portion of the page contained in UpdatePanel is updated, and after returning HTML from the service side, PageRequestManager replaces the code fragment that needs to be updated by manipulating the DOM object.

Take a look at the UpdatePanel work schematics provided by the official website:

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.