All updatepanel are getting updated when i perform updation in first updatepanel

Posted by Suraj1.Niit under ASP.NET AJAX on 1/28/2014 | Points: 10 | Views : 668 | Status : [Member] | Replies : 1
I've two updatepanel on my page. When I click on button inside first updatepanel the second updatepanel is getting updated.




Responses

Posted by: kgovindarao523-21772 on: 1/28/2014 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,
I took a scenario as you posted, then tried like this. this works fine. i am not getting any issue as you did.
My code is:

.aspx file
<div>

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label Text="text" runat="server" ID="lblDisplay1" />
<asp:Button Text="Submit1" runat="server" ID="btnSubmit1" OnClick="btnSubmit1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Label Text="text" runat="server" ID="lblDisplay2" />
<asp:Button Text="Submit2" runat="server" ID="btnSubmit2" OnClick="btnSubmit2_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>

.cs file code:
protected void btnSubmit1_Click(object sender, EventArgs e)

{
lblDisplay1.Text = "Updatepanel1 Called";
}

protected void btnSubmit2_Click(object sender, EventArgs e)
{
lblDisplay2.Text = "Updatepanel2 Called";
}



Thank you,
Govind

Suraj1.Niit, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response