Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between AsyncPostBackTrigger and PostBackTrigger on UpdatePanel? [duplicate]

Tags:

c#

asp.net

I have a GridView(ucLAD) in my UpdatePanel(upnlListing). Inside my ucLAD I have a checkbox and an action for rowClicked:

<asp:UpdatePanel ID="upnlListing" runat="server" >
     <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ucLAD"/>
        <%-- <asp:PostBackTrigger ControlID="ucLAD"/> --%>
     </Triggers>
     <ContentTemplate>
        <asp:Panel ID="pnlRequest" runat="server" style="margin-top:15px; height: auto;">
             <ucgv:BaseGrid runat="server" ID="ucLAD"/>
        </asp:Panel>

     </ContentTemplate>  
</asp:UpdatePanel>

When I use the PostBackTrigger the action performed would be the rowClicked same thing happen when I check the checkbox but when I use the AsyncPostBackTrigger, I can check the checkboxes but when I click the row, the action for rowClicked don't trigger. How can I fix this?

like image 943
Mark Avatar asked Mar 11 '13 01:03

Mark


1 Answers

As describe in on of the SO question

What is the difference between AsyncPostBackTrigger & PostBackTrigger?

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

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

like image 108
शेखर Avatar answered Sep 28 '22 03:09

शेखर