Export (0) Print
Expand All

BaseDataBoundControl.RequiresDataBinding Property

Gets or sets a value indicating whether the DataBind method should be called.

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

member RequiresDataBinding : bool with get, set
<asp:BaseDataBoundControl RequiresDataBinding="True|False" />

Property Value

Type: System.Boolean
The returned value is true if the data-bound control's DataBind method should be called before the control is rendered; otherwise, the value is false.

If you set the RequiresDataBinding property to true when the data-bound control has already begun to render its output to the page, the current HTTP request is not a callback, and you are using the DataSourceID property to identify the data source control to bind to, the DataBind method is called immediately. In this case, the RequiresDataBinding property is not actually set to true.

The following code example demonstrates how the RequiresDataBinding property is used by a derived data-bound control class. After data is retrieved by the GetData method and bound to the control with the PerformDataBinding method, the RequiresDataBinding property is set to false and the MarkAsDataBound method is called to signal that the control has completed binding and no longer requires this property during the current page's lifecycle. This code example is part of a larger example provided for the DataBoundControl class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft