.Net - Describe how to implement event handlers and associate them
with events. - June 03, 2009 at 11:00 AM by Shuchi Gauri
Describe how to implement event handlers and associate them with events.
public class MyClass
{
public static event MyCustomHandler MyEvent;
public static void Main()
{
MyCustomListener mcll = new
MyCustomListener();
MyEvent += new
MyCustomHandler(mcl1.Show);
GetAge();
}
public static void OnMyEvent(MyEventArgse)
{
if(MyEvent!=null)
MyEvent(new object(),e);
}
public static void GetAge()
{
MyEventArgse1 = new
MyEventArgs(25);
OnMyEvent(e1);
}
}
Also read
The Repeater, DataList, and DataGrid controls support event bubbling. What is
event bubbling? Event Bubbling refers to the ability of a control to capture
the events in a child control and bubble up the event to the container whenever
an event occurs...........
Global.asax file contains the following events: Application_Init,
Application_Disposed, Application_Error, Application_Start,
Application_End............
ASP.NET web form supports many server controls like Button, TextBox etc. Each
control has associated events. There are three types of server control
events..............
Server events, State management, Browser detection, Properties.............
Define Exception handling in ASP.NET.
What are the ways of handling exceptions in ASP.NET?
Explain Try/catch block method of exception handling.
Define Error Events.
Define Custom Error Pages.
Why is exception handling important to an application?
When can you use tracing with exception handling?................
A web application starts when a browser requests a page of the application first
time. The request is received by the IIS which then starts ASP.NET worker
process (aspnet_wp.exe). The worker process then allocates a process space to
the assembly and loads it.............
|