How to set Default focus on Button.

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

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">

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


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response