1 / 4

asp.net

ASP.NET is the next version of ASP which provides the easiest way to build, deploy & run the web application on any browser. ASP.NET tutorial is based upon the event-driven and server-side programming model.

amirazam
Télécharger la présentation

asp.net

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Suppose, you want to press/click submit button on Enter key press or you are trying to post the form on Enter key press. In asp.net, to achieve this functionality we need to set "Defaultbutton" property either in Form or in panel. Form Default Button Property <form id="form1" runat="server" defaultbutton="btnSubmit"> <div> <asp:TextBox ID="txtUserID" runat="server"/> <asp:TextBox ID="txtUserpwd" runat="server"/> <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit _Click" Text="Submit"/> </div> </form>

  2. Panel DefaultButton Property <asp:Panel ID="Panel1" runat="server" defaultbutton="btnSubmit"> <div> <asp:TextBox ID="txtUserID" runat="server"/> <asp:TextBox ID="txtUserpwd" runat="server"/> <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit _Click" Text="Submit"/> </div> </asp:Panel > Note • We specify the defaultbutton property at the Form level in the form tag when there is only one Submit Button for post back. • We specify the defaultbutton property at the Panel level in the Panel tag when there are multiple Submit Button for post back.

  3. Summary In this article I try to explain the default submit behavior of form and panel. I hope you will refer this article for your need. I would like to have feedback from my blog readers. Please post your feedback, question, or comments about this article.

More Related