I have a drop down list of servers in an Ajax update. When I use the mouse to click an item, it triggers a postback, but when I press the up / down arrow to change records, it doesnβt work. What could be the reason?
Try the following:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" onKeyUp="this.blur();">
With onKeyUp = "this.blur ();" the control will lose focus when the key is not pressed, and this will raise the onChange event.
Try setting the DropPownList control's AutoPostBack property to true .
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"> </asp:DropDownList>
For more information, see ListControl.AutoPostBack Property on MSDN
Gets or sets a value indicating whether postback on the server will automatically occur when the user changes the list selection.
I think you need to leave the control if you use the keyboard to fire the event.
If you want it to work with arrows, you must use the client-side event, onKeyDown .
onKeyDown