AsyncPostBackTrigger and Refresh UpdatePanel

Last post 08-29-2008 12:24 AM by Pawan_Mishra. 3 replies.

Sort Posts:

  • AsyncPostBackTrigger and Refresh UpdatePanel

    08-28-2008, 4:05 AM

    Hi misters,

    Here we have two UpdatePanels defined with the second one including a declaration for an AsyncPostBackTrigger that wires up the click event of the button contained in the other UpdatePanel. When the user clicks the button, the second UpdatePanel will refresh its contents.

    In  my page,when the user clicks the button, the updToolbar UpdatePanel refresh its contents too, but I want not refresh contents when the user clicks the button, only refresh updDynamicContent UpdatePanel, not updToolbar.

    Any suggestions about it ?? Thanks.

    <asp:UpdatePanel ID="updToolbar" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Button ID="btnRefresh" runat="server" Text="Refresh" />
            </ContentTemplate>
        </asp:UpdatePanel>
       
        <asp:UpdatePanel ID="updDynamicContent" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:GridView ID="gvListOfThings" runat="server"></asp:GridView>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnRefresh" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>


    --
    http://www.alhambra-eidos.es/web2005/index.html
    www.kiquenet.net
    http://www.setbb.com/putainformatica/viewtopic.php?p=843
    www.trabajobasura.com/solusoft

     

    http://www.setbb.com/putainformatica/viewtopic.php?p=843
    www.trabajobasura.com/solusoft
    www.kiquenet.net/churrosoft
  • Re: AsyncPostBackTrigger and Refresh UpdatePanel

    08-28-2008, 9:39 AM
    Answer
  • Re: AsyncPostBackTrigger and Refresh UpdatePanel

    08-28-2008, 11:36 PM
    Answer

    When UpdatePanel controls are not nested you can update each panel independently by setting the UpdateMode property to Conditional. (The default value of the UpdateMode property is Always. This causes the panel to refresh in response to any asynchronous postback.)

    http://www.asp.net/ajax/documentation/live/tutorials/CreatingPageUpdatePanel.aspx 

    If the UpdateMode property is set to Conditional, the UpdatePanel control’s content is updated when one of the following is true:

    • When the postback is caused by a trigger for that UpdatePanel control.

    • When you explicitly call the UpdatePanel control's Update() method.

    • When the UpdatePanel control is nested inside another UpdatePanel control and the parent panel is updated.

    • When the ChildrenAsTriggers property is set to true and any child control of the UpdatePanel control causes a postback. Child controls of nested UpdatePanel controls do not cause an update to the outer UpdatePanel control unless they are explicitly defined as triggers for the parent panel.

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: AsyncPostBackTrigger and Refresh UpdatePanel

    08-29-2008, 12:24 AM
    Answer
    • Star
      8,473 point Star
    • Pawan_Mishra
    • Member since 03-13-2008, 7:37 AM
    • Bangalore
    • Posts 1,249

    Hi , In the updatepanel updToolBar which you do not want to refresh on button click btnReferesh the you can set ChildrenAsTrigger = false for updToolbar updatepanel.

    Regards
    Pawan Mishra

    Too many eyes doesn't make a good code !!!

    .Net 360°
Page 1 of 1 (4 items)