Nested update panel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SimonZ

    #1

    Nested update panel

    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 ChildrenAsTrigg ers="false" on parent update panel.

    How can I do that?

    thanks,
    Simon


  • cfps.Christian

    #2
    Re: Nested update panel

    Set ChildrenAsTrigg ers="false" then within each individual UpdatePanel
    use the <triggerstag (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" ChildrenAsTrigg ers="false"
    UpdateMode="con ditional">
    <ContentTemplat e>
    <UpdatePanel id="Child" ChildrenAsTrigg ers="false"
    UpdateMode="con ditional">
    <ContentTemplat e>
    <!-- Content Here -->
    </ContentTemplate >
    <Triggers>
    <!-- Updates only the child panel -->
    <asp:Asynchrono usPostBackTrigg er
    ControlID="btnC hangeChildPanel " EventName="OnCl ick" />
    </Triggers
    </UpdatePanel>
    <asp:Button id="btnChangeCh ildPanel" runat="server"
    OnClick="btnCha ngeChildPanel_O nClick" />
    </ContentTemplate >
    <Triggers>
    <!-- Add parent triggers here -->
    </Triggers>
    </UpdatePanel>

    Comment

    Working...