Why does updatepanel launch another update panel?

I have two update panels on my ajax page. This is the first time I use updatepanel, and I do not know what is wrong. I think that only the btnFilter Click event should trigger the second content of the update panel, but changing the combo values ​​(which also hides / hides the btnFilter button) makes the second content change the updated palette (at least I see that sometimes data is transferred from Firebug and the second updatepanel). Online here .

<asp:UpdatePanel ID="upComparison" runat="server">
    <ContentTemplate>
        Brand:
        <asp:DropDownList ID="ddlBrands" runat="server" AutoPostBack="true"
        OnSelectedIndexChanged="ddlBrands_SelectedIndexChanged"
        AppendDataBoundItems="true">
            <asp:ListItem Value="" Text="Please select a brand..." />
        </asp:DropDownList>
        <asp:Panel ID="pModels" runat="server" Visible="false">
            Model:
            <asp:DropDownList ID="ddlModels" runat="server" AutoPostBack="true"
            OnSelectedIndexChanged="ddlModels_SelectedIndexChanged" />
        </asp:Panel>
        <asp:Panel ID="pButton" runat="server" Visible="false">
            <asp:UpdateProgress ID="upMain" runat="server" DisplayAfter="100">
                <ProgressTemplate><img src="/Assets/Images/loader.gif" />
                </ProgressTemplate>
            </asp:UpdateProgress>
            <asp:Button ID="btnFilter" runat="server" Text="Filter" 
            OnClick="btnFilter_Click" />
        </asp:Panel>
    </ContentTemplate>
</asp:UpdatePanel>    
<asp:UpdatePanel ID="upList" runat="server">
    <ContentTemplate>
        <asp:Repeater ID="rProducts" runat="server">
            <ItemTemplate>some code here</ItemTemplate>
        </asp:Repeater>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnFilter" EventName="Click" />
    </Triggers>
</asp:UpdatePanel>
+3
source share
1 answer

UpdatePanel .

, UpdateMode Conditional.

+10

Source: https://habr.com/ru/post/1747780/


All Articles