dloendorf
asked on
How to make Enter key fire ASP:Button event for DropDownList control after an autopostback?
I would like to use the Enter key to act as though a Find button was pressed. I have no problem doing this if the last field the user typed in is a text field. However, I have many DropDownList controls and I want to be able to have the user select an item from the drop-list and press Enter and have the Find button fire. Again this works just fine if the DropDownList does not have autopostback set to true. If autopostback is set to true the Enter key does nothing. If I again select the same item from the drop-list (which means the post back does not happen as it is the same item) the Enter key does act as the Find button. The Find button is an Asp:Button type. My question - How do I make the Enter key work for a DropDownList control that has posted back immediately after the post back? Thanks - David
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
string SCRIPT = "<script type=\"text/javascript\">"
SCRIPT += this.GetPostBackEventRefer
SCRIPT += "</script>";
if (!Page.IsStartupScriptRegi
Page.RegisterStartupScript