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
dloendorfAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

faifaiCommented:
add the following in the command of your DropDownList control post back and see if this help, or you may try to add the javascript in the attribute of body onload in the command of your DropDownList control post back if it's not working, and remove it inside the Find_Button poastback command,

string SCRIPT = "<script type=\"text/javascript\">";
SCRIPT += this.GetPostBackEventReference(this.your_findButton);
SCRIPT += "</script>";

if (!Page.IsStartupScriptRegistered("Find")
      Page.RegisterStartupScript("Find", SCRIPT);
      
0
manojkumarpsCommented:
Hello dloendorf,
            I am very sorry to say this but if you have a dropdownlist then you cannot make the enter key event to be fired for a default button unless the ficus is out of the dropdownlist.

          Microsoft still are working on it.

regards,
Manoj
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.