I have two update panels in the same page, both have their updatemode set to conditional. Inside each update panel are various controls. When I click on the controls in one it changes the other, I thought update panels were meant to stop this?
Specifically, the text in a databound label (bound to a linq data source) in one update panel vanishes when a checkbox (also databound, but to a different datasource) is clicked in the other.
I have two update panels in the same page, both have their updatemode set to conditional. Inside each update panel are various controls. When I click on the controls in one it changes the other, I thought update panels were meant to stop this?
In order to stop it, you can set the UpdateMode as Conditional. Please see the demo below:
Specifically, the text in a databound label (bound to a linq data source) in one update panel vanishes when a checkbox (also databound, but to a different datasource) is clicked in the other.
Please see whether the text in a databound label is created in the code behind. When it is created in the code behind, it will be destroied when do a postback.
Best wishes,
Please mark the replies as answers if they help or unmark if not.
Feedback to us
hogg1980
Member
38 Points
33 Posts
Update panels change even when updatemode=conditional
Nov 19, 2012 08:14 PM|LINK
I have two update panels in the same page, both have their updatemode set to conditional. Inside each update panel are various controls. When I click on the controls in one it changes the other, I thought update panels were meant to stop this?
Specifically, the text in a databound label (bound to a linq data source) in one update panel vanishes when a checkbox (also databound, but to a different datasource) is clicked in the other.
The problem only affects the databound control,
Catherine Sh...
All-Star
23382 Points
2490 Posts
Microsoft
Re: Update panels change even when updatemode=conditional
Nov 23, 2012 05:23 AM|LINK
Hi,
In order to stop it, you can set the UpdateMode as Conditional. Please see the demo below:
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <%=DateTime.Now.ToString() %> <asp:Button ID="Button1" runat="server" Text="Button" /> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <%=DateTime.Now.ToString() %> <asp:Button ID="Button2" runat="server" Text="Button" /> </ContentTemplate> </asp:UpdatePanel>Please see whether the text in a databound label is created in the code behind. When it is created in the code behind, it will be destroied when do a postback.
Best wishes,
Feedback to us
Develop and promote your apps in Windows Store