Export (0) Print
Expand All

BaseDataBoundControl.DataBind Method

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)

abstract DataBind : unit -> unit  
override DataBind : unit -> unit

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft