.Net - Explain how to declare and raise events from your
application. - June 03, 2009 at 11:00 AM by Shuchi Gauri
Explain how to declare and raise events from your application.
Declare Events: “Event” keyword is used to declare an event.
public delegate void MyCustomHandler(object o, MyEventArgse);
public class MyEventArgs: EventArgs
{
public readonly int Age;
public MyEventArgs(int age)
{
Age = age;
}
}
public class MyCustomListener
{
public void Show(object o, MyEventArgs e)
{
Console.WriteLine(
"Age is {0}",
e.Age);
}
}
Also read
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?................
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............
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.............
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.............
|