Event Driven Programming in ASP.net

By: Emiley J. Emailed: 1644 times Printed: 2112 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

The two models of program execution (which are not necessarily mutually exclusive) are linear and event-driven.

Linear programs move in a linear fashion, from step 1 to step 2 and so on, to the end of all the steps. Flow control structures within the code (such as loops, if statements, or function or subroutine calls) may redirect the flow of the program, but essentially, once program execution begins, it runs its course unaffected by anything the user or system may do. Prior to the advent of GUI environments, most computer programs were linear.

In contrast, event-driven programming responds to events. An event is generated (or raised) when "something happens," such as the user pressing a button. Often, events are generated by user action, but events can also be generated by the system starting or finishing work. For example, the system might raise an event when a file that you open for reading has been read into memory or when your battery's power is running low.

Windows is an event-driven program. The operating system is relatively quiescent until it detects an event such as the user clicking the mouse on a button. The click raises an event, which must be handled. The method that responds to the event is called the event handler. When the event is raised, the event handler, if one exists, is automatically executed by Windows.

In ASP.NET, objects may raise events and may have assigned event handlers. For example, a button may raise the Click event and may have an OnClick method that handles the event.

The event handler name is formed by prepending the word "On" to the event name, so in the case of a Click event, the event handler is called OnClick. Table below lists some of the more commonly used events and the names of their event handlers.

 
Common events and their event handler names

Event name

Event handler name

Applies to

BubbleEvent

OnBubbleEvent

All controls

CheckedChanged

OnCheckedChanged

CheckBox

Click

OnClick

Button, LinkButton, ImageButton

DataBinding

OnDataBinding

All controls

Init

OnInit

All controls

ItemCreated

OnItemCreated

Repeater

ItemDataBound

OnItemDataBound

Repeater

Load

OnLoad

All controls

PreRender

OnPreRender

All controls

SelectedIndexChanged

OnSelectedIndexChanged

DataGrid, DataList, CheckBoxList, DropDownList, ListBox, RadioButtonList

TextChanged

OnTextChanged

TextBox

Unload

OnUnload

All controls


Asp Home | All Asp Tutorials | Latest Asp Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

Thanks...

Rohit
xpode.com


View Tutorial          By: Rohit at 2012-04-30 04:18:12

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Emiley J.
Error generating R.java from manifest
ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client
IIS and Tomcat - how to configure to work together
PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/php4/lib/php/extensions/no-debug ......
Adding your own Application icon for your J2ME application (jar file)
Creating Menus in Code using VB.net
Traversing all files in a directory using Ruby
Using Proxy to connect to URLs in Ruby
POST a form in Ruby
Reading URL content using Ruby (HTTP)
dRuby client/server mode sample program
Benchmark module in Ruby
encoding and decoding in Ruby using Base64 Module
Module Abbrev in Ruby
Standard Library Packages in Ruby

More Tutorials in Asp
IsPostBack in ASP.net
What is Code-Behind in ASP.net
ASP Versus ASP.NET Events
Lifecycle of a web form in ASP.net
Directives in ASP.net
DataGrid Control in ASP.net
Advantages of Stored Procedures
Event Driven Programming in ASP.net
Advantages of ASP.NET
What is ASP.NET?
Visual Basic .NET Vs Visual C# - (Differences)
IIS and WAP. Configuring IIS to deliver WML (WAP content)
Getting started with ASP
ActiveX component can't create object: 'CDONTS.NewMail' - ASP

More Latest News
Most Viewed Articles (in Asp )
What is Code-Behind in ASP.net
Event Driven Programming in ASP.net
Advantages of ASP.NET
Lifecycle of a web form in ASP.net
Getting started with ASP
Advantages of Stored Procedures
Directives in ASP.net
DataGrid Control in ASP.net
IIS and WAP. Configuring IIS to deliver WML (WAP content)
What is ASP.NET?
Visual Basic .NET Vs Visual C# - (Differences)
IsPostBack in ASP.net
ASP Versus ASP.NET Events
ActiveX component can't create object: 'CDONTS.NewMail' - ASP
Most Emailed Articles (in Asp)
IsPostBack in ASP.net
Lifecycle of a web form in ASP.net
Getting started with ASP
DataGrid Control in ASP.net
IIS and WAP. Configuring IIS to deliver WML (WAP content)
What is ASP.NET?
ActiveX component can't create object: 'CDONTS.NewMail' - ASP
Advantages of ASP.NET
Visual Basic .NET Vs Visual C# - (Differences)
What is Code-Behind in ASP.net
ASP Versus ASP.NET Events
Event Driven Programming in ASP.net
Advantages of Stored Procedures
Directives in ASP.net