Asp.net
ASP.NET Dropdownlist selectedindexchanged 事件未在向上/向下箭頭上觸發
我在Ajax更新面板中有一個伺服器下拉列表。當我使用滑鼠點擊一個項目時,它會觸發回發,但是當我點擊向上/向下箭頭更改條目時,它不會觸發。可能是什麼原因?
嘗試這個:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" onKeyUp="this.blur();">使用onKeyUp=“this.blur();” 當未按下某個鍵時,控制項將失去焦點,這將觸發 onChange 事件。
嘗試將DropDownList 控制項的“ AutoPostBack ”屬性設置為“ true ”。
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"> </asp:DropDownList>有關詳細資訊,請參閱MSDN 上的 ListControl.AutoPostBack 屬性
獲取或設置一個值,該值指示當使用者更改列表選擇時是否自動回發到伺服器。