Home ASP.NET Hosting Dedicated Servers Contact Us
Announcements
Virtual Tiers
.NET Applications
XML Web Services
SQL Server Database
Web Traffic Statistics
Much More...
ASP.NET Web Site Hosting
Dedicated Servers
Windows 2003 Server
2.4 GHz Pentium 4
1024 MB RAM
80 GB Hard Drive
1000 GB/month
Fully Managed
Free Setup!
$268.00/month
Windows Dedicated Servers
Specialized Plans
10 or more Domains
Windows Services
Custom Plans
Windows Services
Learning & Support
About Us



ASP.NET Declare Events



Learn More about Server Intellect



ASP.NET Language Guide

C#

// Create a public event
public event EventHandler MyEvent;
// Create a method for firing the event
protected void OnMyEvent(EventArgs e) {
MyEvent(this, e);
}

VB.NET

' Create a public event
Public Event MyEvent(Sender as Object, E as EventArgs)
' Create a method for firing the event
Protected Sub OnMyEvent(E As EventArgs)
RaiseEvent MyEvent(Me, E)
End Sub

JScript.NET

JScript does not support the creation of events. JScript can only
consume events by declaring event handler delegates and adding those
delegates to the events of another control.