Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested UpdatePanel Triggers

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.

like image 243
Zack Peterson Avatar asked Oct 20 '09 16:10

Zack Peterson


2 Answers

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

</asp:UpdatePanel>
like image 131
rick schott Avatar answered Sep 21 '22 23:09

rick schott


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.

like image 35
Zack Peterson Avatar answered Sep 18 '22 23:09

Zack Peterson