C# : Tutorial of Asp.net with c# and example

Example and code about windows application, web application, SQL, C#, WPF etc which is helpful to developer and programer.

Search This Blog

Asp.Net: How to make Button make as default button in asp.net?

♠ Posted by Unknown in at Sunday, October 12, 2014

How to make button as default button?

Your Button put in panel and give button id in DefaultButton property of panel. most of people think and find Button's property to make it default but actually here asp panel is require and set panel's property DefaultButtton="Here write button id which you want to make default"  .

<asp:Panel ID="pnl1" runat="server" DefaultButton ="Button1">
  <asp:Button ID="Button1" runat="server" text="Click Me!" />
   <asp:Button ID="Button2" runat="server" text="PushMe" />

Here  your default button is  Button1
Using this functionality no need to click by button just enter and click event of default button is occures.

Here other property of button control is text which text you can see on button like as below image :


Improve Your Answer as comment below.
If our post is useful please share and comment on our post for more post and detail Visit :




Post a Comment