Key press "Enter" does not submit the form

A

Andrea Williams

I've created a simple search form and a submit button. On click of the
button, I have code-behind that runs and fills a datagrid. However, it the
person is focused on one of the other controls and presses the "Enter"
button, my submit button event code doesn't fire so my datagrid is either
empty, or it shows a lot of blank rows. It looks like the submit happened,
but since my code to fill the datagrid is in the submit_click method, it's
not executed.

So how can I get the "Enter" button to execute the event method for the
submit button? Is there a way to handle the key press event and make it run
the submit_click method?

Thanks,
Andrea
 
S

Steve C. Orr [MVP, MCSD]

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top