This documentation is archived and is not being maintained.

BaseDataBoundControl.EnsureDataBound Method

Calls the DataBind method if the DataSourceID property is set and the data-bound control is marked to require binding.

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

protected virtual void EnsureDataBound ()
protected void EnsureDataBound ()
protected function EnsureDataBound ()
Not applicable.

The EnsureDataBound method is called during the OnPreRender method, to call the DataBind method if the data-bound control is not yet bound.

This is the same behavior pattern that the BaseDataList (from which classes such as DataGrid are derived) and Repeater classes follow. The EnsureDataBound method might also be called during calls to CreateChildControls and LoadPostData methods.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: