Reputation: 36774
What is the best way to implement mutliple Default Buttons on a ASP.NET Webform?
I have what I think is a pretty standard page. There is a login area with user/pass field and a login button. Then elsewhere on the same page there is a single search field with a search button.
Upvotes: 1
Views: 450
Reputation: 58773
Use a helper function like this one to tie the textboxes to their associated buttons.
Upvotes: 1
Reputation: 2104
asp:Panel
has a property named DefaultButton
. You just need to encapsulate your markup portions with appropriate panels and set the default buttons for each.
Upvotes: 8
Reputation: 2102
Capture the enter key press for each area of the screen and then fire the corresponding button's click even.
Upvotes: 1