This documentation is archived and is not being maintained.

DataBoundControl Class

Serves as the base class for all ASP.NET version 2.0 data-bound controls that display their data in list or tabular form.

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

[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class DataBoundControl abstract : public BaseDataBoundControl
<asp:DataBoundControl />

The DataBoundControl class is the base class used for ASP.NET controls that retrieve tabular or list-style data from an ASP.NET data source control and bind user-interface (UI) elements of the control to that data for display. Composite data-bound controls such as GridView, DetailsView, and FormView; list-style data-bound controls such as BulletedList and CheckBoxList; and other controls such as AdRotator derive from DataBoundControl.

Page developers do not use the DataBoundControl class directly; instead, they use controls that derive from this class.

Control developers extend this class to create data-bound controls that work with classes that implement the IDataSource interface and classes that derive from the DataSourceControl and DataSourceView classes. When deriving a class from the DataBoundControl class, override the PerformDataBinding method to bind the UI elements of your control to data retrieved by the GetData method. In most cases, the PerformDataBinding method is the only method you will override in your derived class.

For ASP.NET 2.0 data-bound controls, the PerformSelect method is the equivalent of the DataBind method, and is called to bind data at run time. The PerformSelect method calls the GetData and PerformDataBinding methods.

The following code example demonstrates how to derive a class from the DataBoundControl class to create a custom data-bound control. The TextBoxSet control creates a TextBox control for each data item retrieved from its associated data source control, and binds to the value of the data item at run time. The current implementation of the Render method renders the TextBox controls as an unordered list.

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

The following code example demonstrates how to use the TextBoxSet control, defined in the previous example, and bind it to an AccessDataSource control.

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0