| HTML Tutorials |
|
|
| XML Tutorials |
|
|
| Browser Scripting |
|
|
| Server Scripting |
|
|
| .NET (dotnet) |
|
|
| Multimedia |
|
|
| Web Building |
|
|
| Java Tutorials |
|
|
| Programming Langauges |
|
|
| Soft Skills |
|
|
|
| ASP.NET - The Button Control |
|
To display a push button,the Button control is used.
|
|
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.
The Button control's attributes and properties are listed in
our
web controls reference page.
The example below demonstrates a simple Button control:
|
<html>
<body>
<form runat="server">
<asp:Button id="b1" Text="Submit" runat="server" />
</form>
</body>
</html>
|
|
|
Add a Script
|
|
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
|
|
| HTML Quizes |
|
|
| XML Quizes |
|
|
| Browser Scripting Quizes |
|
|
| Server Scripting Quizes |
|
|
| .NET (dotnet) Quizes |
|
|
| Multimedia Quizes |
|
|
| Web Building Quizes |
|
|
| Java Quizes |
|
|
| Programming Langauges Quizes |
|
|
| Soft Skills Quizes |
|
|
|