System.Web.UI.Control.DataBind Method

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

Syntax

public virtual void DataBind ()

Remarks

Use this method to bind data from a source to a server control. This method is commonly used after retrieving a dataset through a database query. Most controls perform data binding automatically, which means that you typically do not need to call this method explicitly.

This method is commonly overridden when you create a custom templated data-bound control. For more information, see How to: Create Templated User Controls and Developing Custom Data-Bound Web Server Controls. When called on a server control, this method resolves all data-binding expressions in the server control and in any of its child controls.

Requirements

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