Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

ASP.NET Ajax Update Panel

Modified: 2008/12/03 19:16 by r.ernst - Categorized as: ASP.NET, Front-end, Visual Studio
See: http://www.asp.net/AJAX/Documentation/Live/overview/PartialPageRenderingOverview.aspx

Partial-page rendering removes the need for the whole page to be refreshed as the result of a postback.

- Only individual regions of the page that have changed are updated
- As a result, users do not see the whole page reload with every postback.
- Add partial-page rendering without writing client script

< asp:UpdatePanel ID="UpdatePanel1" runat="server" >
< ContentTemplate >
Place updatable markup and controls here.
< /ContentTemplate >
< /asp:UpdatePanel >

Asynchronous Postback

- All the server page life-cycle events occur, and view state and form data are preserved
- In the rendering phase, only the contents of the UpdatePanel control are sent to the browser. The rest of the page remains unchanged


- AsyncPostbackTrigger (default)
- PostbackTrigger

You can specify:
- A Page Postback inside an UpdatePanel
- That controls outside the UpdatePanel cause an Asynchronous Postback refreshing the UpdatPanels content

Nested UpdatePanels

Useful when you want to be able to:
- refresh specific regions of the page separately
- refresh multiple regions at the same time

Set for both outer and nested UpdatPanel: UpdateMode = “Conditional”

- The outer panel will not refresh if only the inner panel is refreshing
- If the outer panel is refreshed, the nested panels are refreshed also

ScriptManager required

The UpdatePanel control requires a ScriptManager control in the WebPage.
< ajax:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true“ / >


Provides status information about partial-page updates in UpdatePanel controls

< asp:UpdateProgress ID="UpdateProgress1" runat="server" >
< ProgressTemplate >
An update is in progress...
< /ProgressTemplate >
< /asp:UpdateProgress >

You can customize the default UpdateProgress control.
Specify a delay to prevent flashing when a partial-page update is very fast.

 © Evident Interactive BV