Posting a form data using Enter key in Asp.Net using Single submit Button

Posted by Vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 176
If we have few Textboxes and one Submit Button then add the Defaultbutton property in the form tag and assign the button id to Defaultbutton property as like below:-

<form id = "frm" runat = "server" defaultbutton = "btnSubmit">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>

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

Comments or Responses

Login to post response