Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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()

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft