ASP.NET Dropdownlist selectedindexchanged事件未在向上/向下箭头上触发

leo*_*ora 7 asp.net events drop-down-menu

我在Ajax updatepanel中有一个服务器下拉列表.当我使用鼠标点击一个项目时,它会触发回发,但是当我单击向上/向下箭头来更改条目时,这不会触发.可能是什么原因?

Dha*_*ust 10

尝试将DropDownList控件的" AutoPostBack "属性设置为" true ".

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true">
</asp:DropDownList>
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请参阅MSDN上的ListControl.AutoPostBack属性

获取或设置一个值,该值指示当用户更改列表选择时是否自动发生到服务器的回发.


CMS*_*CMS 9

试试这个:

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" onKeyUp="this.blur();">
Run Code Online (Sandbox Code Playgroud)

使用onKeyUp ="this.blur();" 当一个键被按下时,控件将失去焦点,这将触发onChange事件.