Export (0) Print
Expand All

BaseDataBoundControl.DataBind Method ()

Note: This method is new in the .NET Framework version 2.0.

Binds a data source to the invoked server control and all its child controls.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public override void DataBind ()
public void DataBind ()
public override function DataBind ()

The BaseDataBoundControl class overrides the DataBind method to identify the data source that the data-bound control binds to and builds the appropriate control trees. When resolving the data source, the data source identified by the DataSourceID property takes precedence. If DataSourceID is not set, the object identified by the DataSource property is used.

The DataBind method is sealed on all ASP.NET data-bound controls derived from BaseDataBoundControl. Data-bound controls derived from the DataBoundControl and HierarchicalDataBoundControl classes should override the PerformDataBinding method instead of the DataBind method to bind data. If DataBind is overridden, the OnDataBinding and OnDataBound events are raised out of order.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft