Export (0) Print
Expand All

BaseDataList.DataBind Method

Binds the control and all its child controls to the specified data source.

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

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

Use the DataBind method to bind the data source specified by the DataSource property to the data listing control. By binding the data source to a data listing control, the information in the data source is displayed in a data listing control.

The DataBind method is also commonly used to synchronize the data source and a data listing control after information in the data source is updated. This allows any changes in the data source to also be updated in a data listing control.

If the data source for the data listing control is specified by the DataSourceID property, you do not need to call the DataBind method. ASP.NET calls this method automatically to bind the specified data source control to the data listing control.

The following code example demonstrates how to use the DataBind method to bind a data source to a DataGrid control.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.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