当我使用DropDownList1_SelectedIndexChanged作为UpDatePanel的触发器时,它不起

本文关键字:触发器 UpDatePanel 作为 DropDownList1 SelectedIndexChanged | 更新日期: 2023-09-27 18:13:40

提示是" DropDownList1 "没有找到" DropDownList1_SelectedIndexChanged "

</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
   <ContentTemplate>
    <asp:DropDownList ID="DropDownList1" runat="server" 
        onselectedindexchanged="DropDownList1_SelectedIndexChanged">
        <asp:ListItem>1</asp:ListItem>
    </asp:DropDownList>
   </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="DropDownList1_SelectedIndexChanged" /> 
        </Triggers>

请告诉我该怎么做!

当我使用DropDownList1_SelectedIndexChanged作为UpDatePanel的触发器时,它不起

你需要AutoPostBack=True

<asp:DropDownList ID="DropDownList1" runat="server"  AutoPostBack="True"   
        onselectedindexchanged="DropDownList1_SelectedIndexChanged">