0

我正在尝试实现 UpdatePanels 和 UpdateProgress 控件。我有两个 UpdatePanel,其中包含两个不同的 DropDownLists(ddlQuestion5IDs 和 ddlQuestion6IDs)。

当我更改 ddlQuestion6IDs 的选定索引时,UpdateProgress 会为两个 UpdatePanels/DropDownLists 加载。这是他们通常的行为方式吗?有没有办法只为每个 UpdatePanel 显示相应的 UpdateProgress?

        <p>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Label ID="Label6" runat="server" Text="Question 5:" Font-Bold="true"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddlQuestion5IDs" runat="server" OnSelectedIndexChanged="ddlQuestion5IDs_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="true">
                        <ProgressTemplate>
                            <img src="images/loader.gif" height="20" />
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                    <br />
                    <asp:Label ID="Label19" runat="server" Text="Question type:" Font-Italic="true"></asp:Label>
                    <br />
                    <asp:Label ID="lblQuestion5Type" runat="server" Text=""></asp:Label>
                    <br /><br />
                    <asp:Label ID="Label22" runat="server" Text="Question:" Font-Italic="true"></asp:Label>
                    <br />
                    <asp:Label ID="lblQuestion5" runat="server" Text=""></asp:Label>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="ddlQuestion5IDs" EventName="SelectedIndexChanged"/>
                </Triggers>
            </asp:UpdatePanel>
        </p>
        <p>
            <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Label ID="Label7" runat="server" Text="Question 6:" Font-Bold="true"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddlQuestion6IDs" runat="server" OnSelectedIndexChanged="ddlQuestion6IDs_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
                    <asp:UpdateProgress ID="UpdateProgress2" runat="server" DynamicLayout="true">
                        <ProgressTemplate>
                            <img src="images/loader.gif" height="20" />
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                    <br />
                    <asp:Label ID="Label21" runat="server" Text="Question type:" Font-Italic="true"></asp:Label>
                    <br />
                    <asp:Label ID="lblQuestion6Type" runat="server" Text=""></asp:Label>
                    <br /><br />
                    <asp:Label ID="Label24" runat="server" Text="Question:" Font-Italic="true"></asp:Label>
                    <br />
                    <asp:Label ID="lblQuestion6" runat="server" Text=""></asp:Label>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="ddlQuestion6IDs" EventName="SelectedIndexChanged"/>
                </Triggers>
            </asp:UpdatePanel>
        </p>
4

1 回答 1

1

通过将 AssociatedUpdatePanelID="UpdatePanelID" 属性添加到 UpdateProgress

于 2014-07-23T16:05:12.333 回答