Defines a control and optional event of the control as an asynchronous postback control trigger that causes the UpdatePanel control to refresh.
Use the AsyncPostBackTrigger control to enable controls to be triggers for an UpdatePanel control. Controls that are triggers for an update panel cause a refresh of the panel's content when they post back. An AsyncPostBackTrigger is useful for controls in the following scenarios:
For controls that are outside a panel to cause a panel refresh.
For controls that are inside a panel when the ChildrenAsTriggers property is false to cause a panel refresh.
For controls that are inside nested panels to cause a refresh of parent panels.
The control that the AsyncPostBackTrigger references must be in the same naming container as the update panel for which it is a trigger. Triggers that are based on controls in other naming containers are not supported.
Add AsyncPostBackTrigger controls either by using the UpdatePanelTrigger Collection Editor dialog box in the designer or by creating a <Triggers> element declaratively in the UpdatePanel control. The ControlID property is required, but the EventName property is optional. If the EventName property is not specified, the DefaultEventAttribute of the control is used to determine the default event. For example, the default event for the Button control is the Click event. The EventName property is case-insensitive.
You can also reference a naming container as a trigger. In this case, all child controls in the container that cause a postback will be considered triggers for the UpdatePanel.
Programmatically adding AsyncPostBackTrigger controls is not supported. Use the RegisterAsyncPostBackControl(Control) method of the ScriptManager control to programmatically register a postback control, and then call the Update() method of the UpdatePanel when the control posts back.
An exception will occur if you define a control as both a PostBackTrigger and an AsyncPostBackTrigger.
The following example demonstrates how to add an AsyncPostBackTrigger declaratively. A Button control that is outside an UpdatePanel control lets users enter a search term to find in the Products table of the Northwind database. A GridView control that is inside the UpdatePanel control shows the results. The Button is specified as an AsyncPostBackTrigger for the UpdatePanel control.
Assembly: System.Web.Extensions (Module: System.Web.Extensions)