嵌套的UpdatePanel触发器触发器、嵌套、UpdatePanel

2023-09-03 07:17:04 作者:感受浅蓝的淡然

我的孩子的UpdatePanel将同时更新其内容,并与其父的UpdatePanel。

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>

我不希望我的父母的UpdatePanel每次更新其子更新。

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

推荐答案

将UpdatePanel.UpdateMode物业以条件

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

工程酷:

儿童更新面板刷新只有它的   内容并且不刷新的   家长更新面板,除非该   更新模式父更新   面板没有被设置为条件

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

$c$cClimber:

当设置为条件,在   的UpdatePanel将只在更新   回传发起的控制内   面板或从触发器   指定。所以,如果你有多个   更新面板,你不想   更新所有需要更新一次   时间,你必须将UpdateMode   要有条件的。

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.