views:

49

answers:

1

I have two update panels at my ajax page. This is first time I'm using updatepanel and I don't know what is wrong. I think only btnFilter's Click event must trigger the second update panel's content but changing combo values (which also hides/unhides btnFilter button) makes second updatepanel change content (at least I see transferred data with firebug & second updatepanel blinks sometimes). 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>
+5  A: 

By default, every UpdatePanel will be refreshed during every asynchronous postback.

To change this behavior, set the UpdateMode property to Conditional.

SLaks
+1, I wonder why it's set to `Always` by default anyway. Must be the same retardation as behind `EnableViewState` being true by default...
Matti Virkkunen