ASP.NET refresh Update Panel

I have a ListView inside of an Update Panel and wanted to change the Select Query from the code behind fired by a button click event and then reload the ListView inside of the Update Panel. Does anyone know how to cause the Update Panel to refresh from the code behind?

Thanks, Sean


ANSWERS:


Just do:

YourUpdatePanelId.Update();

From MSDN:

If the page is enabled for partial-page rendering, when you invoke the Update method, the UpdatePanel control's content is updated in the browser. Call the Update method if you have server code that must execute to determine whether an UpdatePanel control should be updated. If you plan to use the Update method, set the UpdateMode property to Conditional. If you want the decision to update the panel to be determined in server logic, make sure that the ChildrenAsTriggers property is false and that no explicit triggers are defined for the panel.

In a typical page development scenario, if you define triggers or if the ChildrenAsTriggers property is true for the UpdatePanel control, the Update method is automatically called during the page life cycle.

If the ContentTemplate property is not defined for the UpdatePanel control, no updates of the panel will occur.


Introduction

In this tutorial you will add partial-page update support to a Web page by using two Microsoft ASP.NET 2.0 AJAX Extensions server controls: the ScriptManager control and the UpdatePanel control. These controls remove the requirement to refresh the whole page with each postback, which improves the user experience. For more background on partial-page updates, see Partial-Page Rendering Overview.

You can see the code in action in this tutorial by clicking the Run It buttons. To implement the procedures in your own development environment you need:

Microsoft Visual Studio 2005 or Microsoft Visual Web Developer Express Edition.

The latest release of Microsoft ASP.NET AJAX installed and configured. For more information, see Installing ASP.NET AJAX.

An ASP.NET AJAX Web site.

Use following link :



 MORE:


 ? Create textbox dynamically without postback
 ? Second button Event is not happening in Update panel in aspx page
 ? ASP.Net: click event for dynamic button in dynamically created nested update panel is not raised
 ? button click event on update panel not firing in multiple user control
 ? add a panel or label control dynamically to a datagrid
 ? wxPython - problem with nested sizers, a panel and SetSizer / Fit
 ? ExtJS add panel to panel
 ? ExtJS Add panel above already added panel
 ? c# duplicate panels dynamically
 ? Ext JS - create a tool with dynamic tooltip on a panel