1

我有级联下拉列表,我希望第一个 ddl 触发一个函数并加载第二个 ddl,第二个 ddl 触发另一个函数并加载第三个 ddl。

当我选择第一个 ddl 时,第二个加载正常,但是当我选择第二个 ddl 时,它仍然调用 CategoryList1_SelectedIndexChanged 方法,它们都在调用相同的方法。

我无法弄清楚是什么导致了这个问题。我也尝试过同步,它也不起作用。

任何帮助将不胜感激干杯

<ajax:UpdatePanel ID="CategoryPanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <div class="select">
    <ul>
       <li><strong>KATEGORI:</strong> 
        <asp:DropDownList ID="CategoryList1" AutoPostBack="true"  OnSelectedIndexChanged="CategoryList1_SelectedIndexChanged" runat="server">
        </asp:DropDownList>
        </li>
        <li><strong>MARKA:</strong> 
        <asp:DropDownList ID="CategoryList2" AutoPostBack="true"  OnSelectedIndexChanged="CategoryList2_SelectedIndexChanged" runat="server">
        </asp:DropDownList>
        </li>
        <li><strong>MODEL:</strong>
        <asp:DropDownList ID="CategoryList3" AutoPostBack="true"  OnSelectedIndexChanged="CategoryList3_SelectedIndexChanged" runat="server">
        </asp:DropDownList>
        </li>
        <li class="button"><asp:Button ID="GoButton" OnClick="GoButton_Click" Text="" runat="server" /></li>
        </ul>
    </div>
    </ContentTemplate>

     <Triggers>
            <asp:AsyncPostBackTrigger ControlID="CategoryList1" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="CategoryList2" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="CategoryList3" EventName="SelectedIndexChanged" />
    </Triggers>
</ajax:UpdatePanel>
4

0 回答 0