Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refresh only an UpdatePanel inside another UpdatePanel

If there is UpdatePanel inside another UpdatePanel, and in the inner UpdatePanel there is a button, I want when clicking this button, only refresh the inner UpdatePanel. how ?

like image 555
Adham Avatar asked Aug 07 '12 10:08

Adham


1 Answers

IN the innerupdate panel set the updatemode to conditional and set the outerupdatepanel childrenastriggers property to false. In the inner update panel add a postbacktrigger and set it to the button which will cause the postback. Something like this

  <asp:UpdatePanel ID="parentup" runat="server" ChildrenAsTriggers="false">
    <ContentTemplate>
        <asp:UpdatePanel ID="chidlup" UpdateMode="Conditional" runat="server">
            <ContentTemplate>
                <asp:Button ID="btn" runat="server" />
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btn" />
            </Triggers>
        </asp:UpdatePanel>
    </ContentTemplate>
</asp:UpdatePanel>
like image 111
Waqar Janjua Avatar answered Oct 26 '22 17:10

Waqar Janjua