ASP.Net Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 25707 Page Views: 

How to set default button on a ASP.Net Web Form?



Posted By: Avi Date: 30 November 2009 05:01:16 AM
 Answer:

In ASP.Net 2.0, we can set a default button on a page so that when the user presses the Enter key the button is automatically invoked. To do this we need to add the "defaultbutton" attribute in the form tag.

For example, we have a page with two TextBox controls and two Button controls. We can configure the Submit button to be the default button so it is automatically clicked when a user presses the Enter key. To set the default button of form use following snippet:

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


Posted By: eTechPlanet


Date: 30 November 2009 05:01:16 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image ooXLi3
Related Questions
ASP.Net : How a control can participate in event bubbling?

How a control can participate in event bubbling?

There are two methods through which a control can participate in event bubbling. These methods are i....
Category: ASP.Net Date: 10/2/2010 5:06:20 PM
ASP.Net : What do you mean by bubbling an event?

What do you mean by bubbling an event?

ASP.net provides a technique known as event bubbling which allows a child control to propagate event....
Category: ASP.Net Date: 10/2/2010 5:06:20 PM
ASP.Net : Diffrentiate between Response.Write() and Response.Output.Write()?

Diffrentiate between Response.Write() and Response.Output.Write()?

Response.write:- 1. An unformatted output is displayed. 2. It writes the text stream. 3. It will ou....
Category: ASP.Net Date: 10/2/2010 4:41:19 PM
ASP.Net : Which transport protocol is used to call a Web Service?

Which transport protocol is used to call a Web Service?

SOAP (Simple Object Access Protocol).It is used to exchange information in a decentralised enviropnm....
Category: ASP.Net Date: 10/2/2010 12:20:19 PM
ASP.Net : Name the different types of directives being used in .Net?

Name the different types of directives being used in .Net?

The directives are as follows:- @Page , @Control , @Import , @Implements , @Register , @Assembly
Category: ASP.Net Date: 10/2/2010 3:36:20 AM