Technical Training
ASP.NET TrainingTable of Contents
ASP.NET Web Forms Controls
ASP.NET Hyperlink Controls
ASP.NET Button Controls
ASP.NET List ControlsASP.NET Button Controls
ASP.NET Web Forms Controls
Button Controls:
Button control is also one of the most important control available for developing Asp.net forms. When ever you submit a form you need a button to tell Asp.net parser that you have completed the form that's the basic purpose of the button control. Apart from the display properties and appearance of the button control the most important event raised is button click event.
Here is what the button click event looks like:
- private void Button2_Click(object sender, System.EventArgs e) {
- }
Here the name of the button is Button2, which is the id of the button. The button event takes two parameters which are object sender and System.EventArgs.
the object sender specifies that which button on the form has been clicked. And the next parameter System.EventArgs tells the asp.net that what is being send to the button method.
Below is the list of all the events supported by button control.
Public Events
|
|
Occurs when the Button control is clicked. |
|
|
Occurs when the Button control is clicked. |
|
|
Occurs when the server control binds to a data source. |
|
|
Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested. |
|
|
Occurs when the server control is initialized, which is the first step in the its lifecycle. |
|
|
Occurs when the server control is loaded into thePage object. |
|
|
Occurs when the server control is about to render to its containing Page object. |
|
|
Occurs when the server control is unloaded from memory. |
Lets make a small application that will change the text in the TextBox when the button is clicked.
- private void Button2_Click(object sender, System.EventArgs e) {
- TextBox1.Text = "This is my new Text";
- }
As you see its very simple to raise and capture, capture and take action on the event.
ASP.NET Training
- ASP.NET with C# Training Launch
- ASP.NET with C# Training Course Outline
- Introduction to ASP.NET with C#
- ASP.NET Web Forms Controls
- ASP .NET: Validating User Input with C#
- Using Rich Server Controls with C#
- Accessing Data with C#
- ASP.NET Using the DataList and Repeater, Datagrid Controls
- Managing Data with ADO.NET DataSets and C#
- Creating and consuming XML Web Services with C#
- ASP .NET Migration and Interoperability
- Managing State with ASP.NET and C#
- Caching in ASP.NET
- Configuring and Deploying ASP.NET Applications
- Securing ASP.NET Applications with C#







