Nested update panel

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
 
C

cfps.Christian

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top