5

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?

Mark
  • 8,046
  • 15
  • 48
  • 78

2 Answers2

5

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

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117
  • Sorry but the question here is specific to my problem. There are different results from these different methods. Kindly elaborate your answer. What am I going to do with my codes? What are the specific modifications? – Mark Mar 11 '13 at 06:14
  • http://stackoverflow.com/questions/4912614/what-is-the-different-between-asyncpostbacktrigger-postbacktrigger-really?lq=1 – Ed_ May 06 '15 at 22:55
0

Theoretical explain for AsyncPostBackTrigger and PostBackTrigger above is absolutely Correct. Here I gave You example for those two:

<td style="padding-left: 8px;">
     <asp:UpdatePanel  runat="server" ChildrenAsTriggers="false" UpdateMode="conditional">
         <ContentTemplate>
         <asp:RadioButton ID="RBtn_InventoryPriceWithPurchase" Text="Inventory Price With Purchase" GroupName="ReportAnalysis" runat="server" AutoPostBack="True" OnCheckedChanged="RBtn_InventoryPriceWithPurchase_CheckedChanged"/>
         </ContentTemplate>
          <Triggers>
           <asp:AsyncPostBackTrigger ControlID="RBtn_InventoryPriceWithPurchase"EventName="CheckedChanged"/>
          </Triggers>
          </asp:UpdatePanel>
</td>

<td style="padding-left: 8px;">
    <asp:UpdatePanel runat="server" ChildrenAsTriggers="True" UpdateMode="Always">
     <ContentTemplate>
  <asp:RadioButton ID="RBtn_MerchandisingReport" Text="Merchandising Report" GroupName="ReportAnalysis" runat="server" AutoPostBack="True" OnCheckedChanged="RBtn_MerchandisingReport_CheckedChanged" />
  </ContentTemplate>
  <Triggers>
 <asp:PostBackTrigger ControlID="RBtn_MerchandisingReport"/>
 /Triggers>
 </asp:UpdatePanel>

Amicable
  • 3,115
  • 3
  • 49
  • 77