Key press "Enter" does not submit the form

  • Thread starter Thread starter Andrea Williams
  • Start date Start date
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
 
Back
Top