Building Interactive User Interfaces with Microsoft ASP.NET AJAX: Triggering Full Page Postbacks From An UpdatePanel
Posted by: 4GuysFromRolla.com Headlines,
on 02 Sep 2009 |
View original | Bookmarked: 0 time(s)
The ASP.NET AJAX UpdatePanel provides a quick and easy way to implement a snappier, AJAX-based user interface in an ASP.NET WebForm. In a nutshell, Web controls within the
UpdatePanel that would normally cause a full page postback trigger a partial page postback, instead. For example, a Button Web control, when clicked, submits the form, causing
the browser to start a full page postback. However, if the Button control is within an UpdatePanel then the UpdatePanel short-circuits the full page postback and performs a
in the UpdatePanels. (For a more in-depth look at the UpdatePanel control, refer back to the Using the UpdatePanel
installment in this article series.)
While we usually want controls within the UpdatePanel to perform a partial page postback, there are scenarios where we need a full page postback. ASP.NET AJAX allows us two
techniques for specifying that certain controls within the UpdatePanel should cause a full page postback. The simplest approach is to define the controls declaratively using
the UpdatePanel's Triggers collection. It is also possible to programmatically specify that a particular control should perform a full page postback, which is useful when
the control(s) that need to perform a full page postback are not created until runtime (such as the Buttons in a GridView).
This article looks at how to configure full page postbacks for particular controls within an UpdatePanel, exploring both the declarative and programmatic techniques. Read
on to learn more!
Read More >