System.Web.UI.Control.DataBind Method

Binds a data source to the invoked server control and all its child controls with an option to raise the Control.DataBinding event.

Syntax

protected virtual void DataBind (bool raiseOnDataBinding)

Parameters

raiseOnDataBinding
true if the Control.DataBinding event is raised; otherwise, false.

Remarks

Use the Control.DataBind(bool) method in a scenario when your custom control overrides the Control.DataBind method and implements the System.Web.UI.IDataItemContainer interface. In this scenario, the custom control calls the Control.DataBind(bool) method with raiseOnDataBinding set to false to ensure that the base class's Control.DataBind method gets called.

The Control.DataBind method invokes the Control.DataBind(bool) method with raiseOnDataBinding set to true.

Note:

Calling the Control.DataBind(bool) method with raiseOnDataBinding set to false causes any child controls to be data bound with the Control.DataBind method.

Requirements

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