Book Review: ASP.NET Ajax Update Panel Control

Published: 17 Aug 2007
By: Kazi Manzur Rashid

Kazi reviews the book written by two ASP.NET Ajax members.

Written by: Matt Gibbs and Bertrand Le Roy
Pages: 60
Publisher: O'Reilly Media
ISBN: 0596527470

 

 

 

Introduction

This book is co-written by two ASP.NET AJAX Team Members and published in O'Reilly shortcut series. Its length is quite short and focuses only one subject: The ASP.NET AJAX UpdatePanel control. It is organized in eight different sections. Let me share my findings with you.

Introducing the UpdatePanel Control

This section starts with the evolving history of Update Panel. It follows a tutorial on how to setup and run an ASP.NET AJAX Project in Visual Studio with minimum configuration settings. Then it moves on discussing some important properties of the UpdatePanel like ContentTemplate, UpdateMode, AsyncPostBackTrigger, PostbackTrigger, RenderMode and few other important topics like ScriptManager dependency, working with the UpdateProgress and Timer controls, aborting an asynchronous postback and registering a control for performing an asynchronous postback. This is a must read section if you are new to the ASP.NET AJAX UpdatePanel control.

Using the UpdatePanel Control

This section contains three examples of increasing complexity, in which the UpdatePanel is used to Ajax-ify the pages. A good starting point if you want to convert your old ASP.NET 2.0 pages to Ajax. The section starts with a very simple Wizard Control wrapped by an UpdatePanel. The next example shows a multi-level Master-Detail demo using the AdventureWorks Database. The demo includes a DropDownList, GridView and FormView controls. It shows how an UpdatePanel can be updated based upon events raised by other controls. The third and final example shows how to create a search page with a popup that displays a “details” preview of the AdventureWorks databases's Product Table. It also shows how to utilize JavaScript with server side controls in order to position an HTML element, which is then shown as a popup.

Repeating UpdatePanels

This section is a continuation of the previous section. It shows how an UpdatePanel can be placed in the ItemTemplate of a DataList or Repeater controls, instead of putting these controls in an UpdatePanel. This is certainly a good choice when we need to update only the data related to a specific item instead of the whole control.

Redirecting from an asynchronous postback

In early days of ASP.NET AJAX, invoking Response.Redirect() during a partial postback throwed an exception. This is not the case in the current release of ASP.NET AJAX. This section describes how the redirect happens in partial rendering mode.

Displaying Error Messages

This section shows how to handle errors during asynchronous postbacks by utilizing the AsyncPostBackErrorMessage property and AsyncPostBackError event of the ScriptManager control.

Client-side representation of UpdatePanel controls and ScriptManager

Although the index does not show this as a section, I think it deserves a separate one. Here, the client side PageRequestManager object is discussed. It is actually responsible for managing the partial update of a page. This section provides the description of the events that are fired during a partial update and explains how to hook these events in order to change the default behavior of the UpdatePanel. A must read if you want to learn what happens under the hoods of the UpdatePanel.

Dealing with Caveats

This section is also equally important in order to understand the details of the UpdatePanel. This section discusses writing custom controls that leverage the UpdatePanel. It focuses on how to register client side scripts when writing custom controls. Then it moves to discussing how nested UpdatePanels should be used. The next topic explains that UpdatePanel requests are sequential; and why it is not possible to allow more than one simultaneous asynchronous postback. This section ends with a discussion on why the xml-script declarative language is not supported in the UpdatePanel; and how to use the File Upload control in the UpdatePanel control.

For Further Reading

This section contains a few useful links on ASP.NET AJAX. I would also recommend checking the following ones:

Appendix: Creating the AdventureProducts.xsd DataSet

Contains instructions and details on setting up the sample code. You can also download the sample code for free.

Summary

This book contains a lot of valuable information on the UpdatePanel especially when it's length and price is taken into account. It lacks providing information on a few important topics like common issues that break the UpdatePanel. It should provide a few more real life examples such as loading controls dynamically, using validators in the UpdatePanel as well as scalability issues of the UpdatePanel. Still I would recommend reading it if you are new to the ASP.NET AJAX UpdatePanel control. I rate it 3.5 out of 5. The book is available for purchase in PDF format from O'Reilly.

About Kazi Manzur Rashid

Kazi Manzur Rashid, Nickname Amit is a Diehard fan of Microsoft Technology. He started programming with Visual Basic 5.0 back in 1996. Since then he has developed many diversified solutions in his professional career, which spans from Anti-Spyware Tool to Personalized Start Page. Currently He is wor...

View complete profile

Top Articles in this category

ASP.NET Ajax Grid and Pager
Learn how to create a custom Ajax Grid and Pager with the Microsoft ASP.NET AJAX platform.

ASP.NET AJAX Control Development
An in depth guide to developing controls with the ASP.NET AJAX

ASP.NET Ajax Web Service
Sharing some of the Common Issues of ASP.NET Ajax Web Services.

Asp.net Ajax Exception Logging
Shows how to create an effective error logging system in ASP.NET AJAX.

JSON-Enabled WCF Services in ASP.NET 3.5
Dino Esposito overviews the integration between WCF and AJAX

Top
 
 
 

Please login to rate or to leave a comment.

Product Spotlight