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:
<script runat="server">
Sub submit(sender As Object, e As EventArgs)
lbl1.Text="Your name is " & txt1.Text
End Sub
</script>
<html>
<body>
<form runat="server">
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>
</form>
</body>
</html>
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords:
asp datagrid,
c# using,
datagrid button,
javascript button,
asp array,
html button,
datagrid control,
event button,
asp javascript,
asp function,
asp database,
asp xml,
datalist control,
control data,
asp form,
asp c#,
repeater control,
custom button,
c# button,
asp session,
onclick button,
dropdownlist control,
datalist button,
button create,
asp code,
button table,
dropdown button,
asp file,
repeater button,
c# control,
event control,
form button,
listbox control,
vb button