ASP. NET-Repeater control

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.