Wednesday, March 28, 2012

AJAX update panel updating all panels!

Hey there, I have 2 updated panels on a page update panel1 and update panel2.

One is triggerd by a list box and the other is triggered by an image button,, the only problem is although each trigger is assigned to their respective list boxes, whenever a trigger is activated it refreshes both update panels, which is not what I want.

This is my update panel refreshed by the image button

<asp:UpdatePanelID="UpdatePanel2"runat="server"><ContentTemplate><TABLEid="Table6"style="WIDTH: 208px; HEIGHT: 248px"cellSpacing="1"cellPadding="1"width="208"border="0"><TR><TDstyle="HEIGHT: 197px; width: 206px;"vAlign="top"align="center"><BR><asp:listboxid="ListBox1"runat="server"Width="143px"Font-Names="Arial"AutoPostBack="True"Height="232px"></asp:listbox></TD></TR></TABLE></ContentTemplate><Triggers><asp:asyncPostBackTriggerControlID="SearchButton"EventName="Click"/></Triggers></asp:UpdatePanel>

Any thoughts on this?

Thanks in advance

You need to set the UpdateMode on the UpdatePanels to "Conditional". By default it is set to "Always" which means it will be updated on any postback.

No comments:

Post a Comment