Brian Boatright
Brian Boatright

Reputation: 36774

Best way to implement mutliple Default Buttons on a ASP.NET Webform

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

Answers (3)

Ian Nelson
Ian Nelson

Reputation: 58773

Use a helper function like this one to tie the textboxes to their associated buttons.

Upvotes: 1

jansokoly
jansokoly

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

Mike Becatti
Mike Becatti

Reputation: 2102

Capture the enter key press for each area of the screen and then fire the corresponding button's click even.

Upvotes: 1

Related Questions