System.Web.UI.WebControls.DataBoundControl.ValidateDataSource Method

Verifies that the object a data-bound control binds to is one it can work with.

Syntax

protected override void ValidateDataSource (object dataSource)

Parameters

dataSource
An object set to the BaseDataBoundControl.DataSource property.

Remarks

The DataBoundControl.ValidateDataSource(object) method is only called in the System.Web.UI.WebControls.BaseDataBoundControl class's mutator (set accessor) for the BaseDataBoundControl.DataSource property. The System.Web.UI.WebControls.DataBoundControl class checks the type of the object that is set for the BaseDataBoundControl.DataSource property to ensure that it is an instance of the System.Web.UI.IDataSource, System.ComponentModel.IListSource, or IEnumerable interface.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0