Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top