ASP.NET Button Control

When developing an ASP.NET Web application using Visual Studio 2010, you can use an ASP.NET Button Control to display a Push button. These ASP.NET Buttons controls can be used as a Submit button or even an Command button.

ASP.NET Button Control do not have command name thus it posts the Web page back to the server when then control is clicked. When using the control an event handler can be coded to control the actions performed when the submit button is clicked.

Note:

  • ASP.NET Button Control is a Submit button by default.
  • ASP.NET Button control as a Command button has a command name which allows you to create multiple Button Controls on a page.
  • By codng an Event Handler, the ASP.NET Button control as a Command button’s actions performanced can be controlled.

Here are a few quick steps on how to add your very own ASP.NET Button Control.

  1. Go to the Toolbox and under the Standard section, select Button Control.

ASP.NET Button Control
ASP.NET Button Control

  1. Drag and drop it onto the Form area to declare it.
  2. The following is the code you get in the Source View.

<asp:Button ID=”Button1″ runat=”server” Text=”Button” />

Related Tutorials:

This entry was posted in ASP.NET Tutorial and tagged , , , , , , . Bookmark the permalink.