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: