views:

514

answers:

3

My child UpdatePanel updates both its contents and those of its parent UpdatePanel.

<asp:UpdatePanel ID="UpdatePanel1" 
                 runat="server">
    ...
    <asp:UpdatePanel ID="UpdatePanel2" 
                     runat="server">
        ...
    </asp:UpdatePanel>
    ...
</asp:UpdatePanel>

I don't want my parent UpdatePanel to be updated every time its child updates.

+2  A: 

Set the UpdatePanel.UpdateMode Property to Conditional.

<asp:UpdatePanel ID="UpdatePanel1" 
                 UpdateMode="Conditional"
                 runat="server">
    ...
</asp:UpdatePanel>

Project Cool:

Child Update Panel refreshes only its contents and doesnt refresh that of the Parent Update Panel unless, the update mode for the parent update panel is not set to Conditional

CodeClimber:

When set to Conditional, the UpdatePanel will be updated only on postback originated by controls inside the panel or from the triggers specified. So, if you have multiple update panels and you don't want to update all of them to be updated every time, you have to set the UpdateMode to Conditional.

Zack Peterson
+2  A: 
<asp:UpdatePanel ID="UpdatePanel1" ChildrenAsTriggers="False"
                 UpdateMode="Conditional"
                 runat="server">

</asp:UpdatePanel>
rick schott
+1  A: 

This is what I do

<asp:UpdatePanel ID="UpdatePanel1" ChildrenAsTriggers="False"
                 UpdateMode="Conditional" runat="server">
    ...
    <asp:UpdatePanel ID="UpdatePanel2" ChildrenAsTriggers="False"
                 UpdateMode="Conditional" runat="server">
        ...
    </asp:UpdatePanel>
    ...
</asp:UpdatePanel>

In the code behind after binding UpdatePanel2 Controls with data, call UpdatePanel2.Update(); Ajax updates only HTML markup in "UpdatePanel2".