ASP.NET Web Forms - Repeater Control
The Repeater control is used to display a repeated list of items bound to the control.
Binding a DataSet to the Repeater Control
The Repeater control is used to display a repeated list of items bound to the control. The Repeater control can be bound to a database table, an XML file, or other item lists. Here, we will demonstrate how to bind an XML file to the Repeater control.
In our example, we will use the following XML file ("cdcatalog.xml"):
View this XML file:cdcatalog.xml
First, import the "System.Data" namespace. We need this namespace to work with the DataSet object. Include the following directive at the top of the .aspx page:
<%@ Import Namespace="System.Data" %>
Next, create a DataSet for the XML file, and load the XML file into the DataSet when the page is first loaded: