System.Web.UI.HtmlControls.HtmlSelect.EnsureDataBound Method

Verifies that the System.Web.UI.HtmlControls.HtmlSelect control requires data binding and that a valid data source control is specified before calling the System.Web.UI.Control.DataBind method.

Syntax

protected void EnsureDataBound ()

Remarks

When you specify a value for the HtmlSelect.DataSourceID property, ASP.NET automatically binds the data listing control to the specified data source control. When ASP.NET performs data binding for the control, it calls the HtmlSelect.EnsureDataBound method first to verify that the control has not already been data-bound and that a valid data source control that implements the System.Web.UI.IDataSource interface is specified for its HtmlSelect.DataSourceID property. The HtmlSelect.EnsureDataBound method then calls the System.Web.UI.Control.DataBind method to ensure that the control is data-bound immediately after the call to this method.

Requirements

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