Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Go to top

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

, 22 Jul 2011
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... PinmemberLisetsky Val25-Jul-11 19: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 | Mobile
Web03 | 2.8.140916.1 | Last Updated 22 Jul 2011
Article Copyright 2011 by Muthu Nadar
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid