Nested update panel

  • Thread starter Thread starter SimonZ
  • Start date Start date
S

SimonZ

I have nested update panels.

When I click on button, which is located in parent update panel, I would like that only child update panel is refreshed.

Now the both panels are refreshed or none if I set ChildrenAsTriggers="false" on parent update panel.

How can I do that?

thanks,
Simon
 
Set ChildrenAsTriggers="false" then within each individual UpdatePanel
use the <triggers> tag (I usually place it right below my
ContentTemplate) to manually specify which controls an update panel
updates on. I almost always use this so I know what is causing my
postbacks and I don't have something I'm not aware of going on.

Example:

<UpdatePanel id="Parent" ChildrenAsTriggers="false"
UpdateMode="conditional">
<ContentTemplate>
<UpdatePanel id="Child" ChildrenAsTriggers="false"
UpdateMode="conditional">
<ContentTemplate>
<!-- Content Here -->
</ContentTemplate>
<Triggers>
<!-- Updates only the child panel -->
<asp:AsynchronousPostBackTrigger
ControlID="btnChangeChildPanel" EventName="OnClick" />
</Triggers
</UpdatePanel>
<asp:Button id="btnChangeChildPanel" runat="server"
OnClick="btnChangeChildPanel_OnClick" />
</ContentTemplate>
<Triggers>
<!-- Add parent triggers here -->
</Triggers>
</UpdatePanel>
 
Back
Top