Nested update panel

Discussion in 'ASP .Net' started by SimonZ, Jun 6, 2008.

  1. SimonZ

    SimonZ Guest

    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
     
    SimonZ, Jun 6, 2008
    #1
    1. Advertising

  2. 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>
     
    cfps.Christian, Jun 6, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry
    Replies:
    3
    Views:
    557
    Harry Singh
    Nov 10, 2003
  2. HS1
    Replies:
    3
    Views:
    499
  3. HS1
    Replies:
    4
    Views:
    8,322
    Babu Kalakrishnan
    Dec 8, 2004
  4. katmagic
    Replies:
    0
    Views:
    1,276
    katmagic
    Dec 26, 2008
  5. Sven Fischer
    Replies:
    0
    Views:
    486
    Sven Fischer
    Oct 22, 2012
Loading...

Share This Page