65.9K
CodeProject is changing. Read more.
Home

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

starIconstarIconstarIconstarIconstarIcon

5.00/5 (6 votes)

Jul 22, 2011

CPOL
viewsIcon

21931

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.