I have two AJAX UpdatePanels on my ASP.NET 2.0 web form. When I clic the LinkkButton which is on the UpdatePanel1, UpdatePanel1 and UpdatePanel2 are updating. How can I Update only the first UpdatePanel? Thanks.
+1
A:
You need to set the UpdatePanels' UpdateModes to Conditional, so that they only respond to events from controls within them.
phoebus
2009-09-23 08:02:38
copypasta wins again
phoebus
2009-09-23 08:09:37
@phoebus : Since your answer is right +1 for it. And about your comment of copy paste please check this meta question posted by me and answered by Chrisf.(http://meta.stackoverflow.com/questions/20692/link-or-copy-paste-code)
Mahin
2009-09-29 11:47:31
+1
A:
Please check the UpdateMode property of your update panel.
The content of an UpdatePanel control is updated in the following circumstances:
- If the UpdateMode property is set to Always, the UpdatePanel control's content is updated on every postback that originates from anywhere on the page. This includes asynchronous postbacks from controls that are inside other UpdatePanel controls and postbacks from controls that are not inside UpdatePanel controls.
- If the UpdatePanel control is nested inside another UpdatePanel control and the parent update panel is updated.
- If the UpdateMode property is set to Conditional, and one of the following conditions occurs:
- You call the Update method of the UpdatePanel control explicitly.
- The postback is caused by a control that is defined as a trigger by using the Triggers property of the UpdatePanel control. In this scenario, the control explicitly triggers an update of the panel content. The control can be either inside or outside the UpdatePanel control that defines the trigger.
- The ChildrenAsTriggers property is set to true and a child control of the UpdatePanel control causes a postback. A child control of a nested UpdatePanel control does not cause an update to the outer UpdatePanel control unless it is explicitly defined as a trigger.
Mahin
2009-09-23 08:02:42