Click here to Skip to main content
11,412,451 members (64,508 online)
Click here to Skip to main content
Alternative Tip/Trick

Tagged as

How to make a button the default button on enter on an ASP.NET form

, 22 Jul 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
You can set the default button on your form tag as below code.ORyou can set the default button on a panel as below.And you can place your...
You can set the default button on your form tag as below code.
<form id="form1"  runat="server" defaultbutton="Button1">

OR

you can set the default button on a panel as below.

<asp:Panel ID="panel1" runat="server" DefaultButton="Button1"></asp:Panel>


And you can place your controls on either form or on the panel.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Muthu Nadar
Team Leader
India India
No Biography provided
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
GeneralReason for my vote of 5 Native solutions are always better t... Pin
Lisetsky Val at 25-Jul-11 20:11
memberLisetsky Val25-Jul-11 20:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150427.1 | Last Updated 22 Jul 2011
Article Copyright 2011 by Muthu Nadar
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid