Events Property

Control.Events Property


Gets a list of event handler delegates for the control. This property is read-only.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

protected EventHandlerList Events { get; }

Property Value

Type: System.ComponentModel.EventHandlerList

The list of event handler delegates.

This property is of type EventHandlerList, which uses a linear search algorithm to find entries in the list of delegates. A linear search algorithm is inefficient when working with a large number of entries. Therefore, when you have a large list, finding entries with this property will be slow.

Legacy Code Example

The following example creates an event, named Click, that adds and removes handlers from the control's EventHandlerList collection when the event is called from a page.

Note   This example optimizes how a control adds and removes events from the list of them that the control maintains. If you create custom control and want to define an event, use code similar to this. This technique can be used in C#, but not in Visual Basic.

Code snippet is not found. Confirm that the code snippet name 'System.Web.UI.Page_VerifyRenderingInServerForm' is correct.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft