Wednesday, September 03, 2008

Make default button on the page

There are different ways control the page behavior when user enter the text in the text box then press the Enter key.

One way is to user the Javascript function to monitor the key pressed. If it's the enter key, then activate the submit button (the default button).

Another way is to put the page around a panel and use the "defaultbutton" property.

The best way to do this is to use the "UseSubmitBehavior" property for the button. Just make it false for buttons that not default.

No comments: