Assembly: System.Web (in system.web.dll)
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.
The following code example demonstrates how to use the TextBoxSet control, defined in the previous example, and bind it to an AccessDataSource control.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.