To display a push button,the Button control is used.
A D V E R T I S E M E N T
The Button Control
To display a push button,the Button control is used. The
push button may be a a command button or submit button. By
default, this control is the submit button.
A submit button does
not have a command name and it posts the page back to the server
when it is clicked and it is possible to write an event handler to
control the actions performed when the submit button is clicked.
A command button allows you to create multiple Button controls on a page and has a command name.
When the command button is clicked,it is possible to write an event handler to control the actions performed.
By clicking on a button,a form is most often submitted.
In the following example we declare one TextBox control, one Button control, and one Label control in an .aspx file and when the submit button is triggered, the submit subroutine is executed. The submit subroutine writes a text to the Label control:
Sub submit(sender As Object, e As EventArgs)
lbl1.Text="Your name is " & txt1.Text
Enter your name:
<asp:TextBox id="txt1" runat="server" />
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.