Click here to Skip to main content
15,923,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends. . . . . I have two updatepanels in my aspx page. . . I want to update the updatepanel2 whenever the updatepanel1 get updated. . . . . Can anybody help me in this regard. . . .
Posted

1 solution

Add trigger in second update panel for control from first update panel for which you want to update second update panel.
Try this solution with removing trigger & you will get idea.

XML
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:Label ID="lbl1" runat="server" Text="lbl1"></asp:Label>
    <asp:Button ID="btn" runat="server" onclick="btn_Click" Text="Click" />
    </ContentTemplate>
    </asp:UpdatePanel>

    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
    <Triggers>
    <asp:PostBackTrigger ControlID="btn" />
    </Triggers>
    <ContentTemplate>
    <asp:Label ID="lbl2" runat="server" Text="lbl2"></asp:Label>
    </ContentTemplate>
    </asp:UpdatePanel>


C#
protected void btn_Click(object sender, EventArgs e)
   {
       lbl1.Text = "change1";
       lbl2.Text = "change2";
   }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900