What is the difference between AsyncPostBackTrigger & PostBackTrigger?
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 after an asynchronous postback.
Description. <asp:AsyncPostBackTrigger> Specifies a control and event that will cause a partial page update for the UpdatePanel that contains this trigger reference. <asp:PostBackTrigger> Specifies a control and event that will cause a full page update (a full page refresh).
The difference between synchronous and asynchronous postback is thatAsynchronous postback renders only the required part of the page and whereas, synchronous postback renders the entire page for any postback.
UpdatePanel controls are a central part of AJAX functionality in ASP.NET. They are used with the ScriptManager control to enable partial-page rendering. Partial-page rendering reduces the need for synchronous postbacks and complete page updates when only part of the page has to be updated.
Controls inside an UpdatePanel by default cause a partial page update, controls outside cause a postback, using these triggers it is possible to change this behaviour as required.
From http://seminaarit.codezone.fi/video/devdays-2007/track1/2/2-ASP-dotNET_AJAX_Extensions.ppt: (dead link)
AsyncPostBackTrigger
- Converts postbacks into async callbacks * Typically used to trigger updates when controls outside an UpdatePanel post back * If ChildrenAsTriggers="false", can be used to specify which controls inside UpdatePanel should call back rather than post back
PostBackTrigger
- Lets controls inside UpdatePanel post back. * Typically used to allow certain controls to post back when ChildrenAsTriggers="true"
Here's a blog post which explains the difference:
In the template in an update panel, there are the options of an AsyncPostBackTrigger or a PostBackTrigger.
By default, controls outside of an update panel will trigger a normal synchronous post back. The AsyncPostBackTrigger “wires” up these controls to trigger an asynchronous post back. Conversely, controls declared inside an update panel will trigger an asynchronous call by default. The PostBackTrigger short circuits this, and forces the control to do a synchronous post back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With