Handling Control Events

All custom controls inherit from the System.Web.UI.Control class, which defines the events described in Table 12.1.

Table 12.1. System.Web.UI.Control Events
Event Method To Override Description
DataBinding OnDataBinding(EventArgs e) Occurs when the server control binds to a data source.
Dispose Dispose() Occurs when a server control is released from memory, after the Unload() event.
Init OnInit(EventArgs e) Occurs when the server control is initialized.
Load OnLoad(EventArgs e) Occurs when the server control is loaded into the Page object.
PreRender OnPreRender(EventArgs e) Occurs when the server control is about to render to its containing Page object.
Unload OnUnload(EventArgs e) Occurs when the server control is unloaded ...

Get ASP.NET by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.