concept UpdatePanel control in category .net

appears as: n UpdatePanel control, UpdatePel control, The UpdatePel control, UpdatePel controls, UpdatePel controls
ASP.NET AJAX in Action

This is an excerpt from Manning's book ASP.NET AJAX in Action.

The program works as expected: Selecting a department retrieves the number of employees and displays the results at the bottom of the page. The only issue is that the page refreshes each time a new department is chosen. Handling this is also trivial; you wrap the contents of the form in an UpdatePanel control (see listing 1.11).

One of the primary objectives of the Ajax server extensions is to find an alternative to some of this undesirable behavior. We’ll go deeper into postbacks later in the chapter and with greater detail in the chapters that address the UpdatePanel control. You should understand now that postbacks cause a full-page refresh to occur, which is a behavior that Ajax applications seek to suppress or eliminate.

4.4.1. Introducing the UpdatePanel control

The UpdatePanel is an Ajax-enabled server control that works closely with the ScriptManager to apply partial-page updates to a page. Portions of the page declared by the UpdatePanel can now be updated incrementally rather than as a result of a page refresh. To demonstrate, let’s add the UpdatePanel control to the existing application.

Figure 6.6. Repeating UpdatePanel controls
Listing 7.7. Adding an UpdatePanel control and child controls to invoke asynchronous postbacks
<asp:Panel ID="Panel1" runat="server" GroupingText="UpdatePanel1"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> Last Updated: <asp:Label ID="LastUpdated1" runat="server" /> <div> <asp:Button ID="Update1" runat="server" Text="Update" OnClick="Update_Click" /> </div> </ContentTemplate> </asp:UpdatePanel> </asp:Panel>