ASP. NET-R epeater control
The Repeater control is used to display a duplicate project list.
A DataSet is bound to the relay control.
The Repeater control is used to display a duplicate project list. The Repeater control can be bound to a database table, an XML file, or a list of other items. Here we will show how to combine the Repeater control of XML files.
We will use the following XML file in our example ("cdcatalog. xml "):
<? Xml version = "1.0" encoding = "ISO-8859-1"?>
<Catalog> <cd> <title> Empire Burlesque </title> <artist> Bob Dylan </artist> <country> USA </country> <company> Columbia </company> <price> 10.90 </price> <year> 1985 </year> </cd> <title> Hide your heart </title> <artist> Bonnie Taylor </ artist> <country> UK </country> <company> CBS Records </company> <price> 9.90 </price> <year> 1988 </year> </cd> <cd> <title> Greatest Hits </title> <artist> Dolly Parton </artist> <country> USA </country> <company> RCA </company> <price> 9.90 </price> <year> 1982 </year> </cd> <title> Still got the blues </title> <artist> Gary Moore </artist> <country> UK </country> <company> Virgin records </company> <price> 10.20 </price> <year> 1990 </year> </cd> <title> Eros </title> <artist> Eros Ramazzotti </artist> <country> EU </country> <company> BMG </company> <price> 9.90 </price> <year> 1997 </year> </cd> </catalog>
Look at the XML file: cdcatalog. xml
First, the imported "System. Data" namespace. We need this name and DataSet object. Includes one of the following commands. Aspx page:
"% @ Import name =" System. Data "%"
Next, create a DataSet XML file and load the XML file to the DataSet webpage first:
<Script runat = "server"> sub Page_Loadif Not Page. IsPostBack then dim mycdcatalog = New DataSet mycdcatalog. ReadXml (MapPath ("cdcatalog. xml") end ifend sub