BaseDataBoundControl.OnDataBound Method (EventArgs)
Raises the DataBound event.
Assembly: System.Web (in System.Web.dll)
This method notifies a server control that any data binding logic associated with the control has completed.
The DataBind method is sealed on all controls derived from BaseDataBoundControl. Data-bound controls should override PerformDataBinding instead of the DataBind method to bind data. If DataBind is overridden, the OnDataBinding and events are raised out of order.
Raising an event invokes the event handler through a delegate. For more information, see NIB: Raising an Event.
Themethod also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors:
When overridingin a derived class, be sure to call the base class’s method so that registered delegates receive the event.
The following code example demonstrates how the DataBound event by a derived data-bound control class. After using the GetData and PerformDataBinding methods to bind data to the control, the data-bound control raises the DataBound event to signal that data binding is complete. This code example is part of a larger example provided for the DataBoundControl class.method is used to raise the
Available since 2.0