How to set Default focus on Button.

 Posted by vishalneeraj-24503 on 12/16/2013 | Category: ASP.NET Interview questions | Views: 1843 | Points: 40

defaultbutton property is used for setting focus on Button.

defaultbutton works as an Enter key.
When user press enter key from keyboard,then Button event automatically fired.

For Example:-

<form id="form1" runat="server" defaultbutton="btnSubmit">

<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit"/>

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response