Default Buttons in ASP.NET 2.0

ASP.NET has this thing where pressing Enter on a page will cause it to be submitted, but no submit action is taken, mostly because you can have multiple buttons on a page, and it isn’t sure which button it should consider clicked when you press enter.

The solution to this was the “__EVENTTYPE” field.  Click here for more info on __EVENTTYPE.

Thankfully ASP.NET 2.0 has introduced some new features to help remove this complexity.

Scott Gu blogs about the new form defaultButton property, as well as the new SetFocusOnError property of the validators here:

http://weblogs.asp.net/scottgu/archive/2005/08/04/421647.aspx

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s