Triggers section of the UpdatePanel- ASP.NET AJAX .

Q.  A button control is located outside the UpdatePanel control. You need that a given button control outside of the UpdatePanel should cause the UpdatePanel to execute an update with partial update. What will you do to achieve this task?
- Published on 24 Jul 15

a.
- Add a PostBackTrigger control to the Triggers section of the UpdatePanel.
- Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
b.
- Add a Trigger control to the Triggers section of the UpdatePanel.
- Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
c.
- Add an AsyncPostBackTrigger control to the Triggers section of the UpdatePanel.
- Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
d. None of the above.

ANSWER:
- Add an AsyncPostBackTrigger control to the Triggers section of the UpdatePanel.
- Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
 

    Discussion

  • Brijesh   -Posted on 20 Oct 15
    If any control is located outside the UpdatePanel control and you want that this outsider control should cause the UpdatePanel to execute an update with partial update then you have to do the following two tasks.
    • Add an AsyncPostBackTrigger control to the Triggers section of the UpdatePanel.
    • Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
    <asp:UpdatePanel ID="UpdatePanelVendors" runat="server">
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
    </Triggers>
    </asp:UpdatePanel>

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)