How to create this ASP:Repeater?

S

Shapper

Hello,

I am trying to get some data from a XML file into a repeater:

MyXML.ReadXml("http://www.mydomain.com/myXmlFile.xml")
MyRepeater.DataSource = MyXML
MyRepeater.DataBind()

My XML file is something like this:

<shop>
<name>...</name>
<email>...</email>
<item>
<title>...</title>
<price>...</price>
</item>
<item>
<title>...</title>
<price>...</price>
</item>
...
</shop>

My problems are as follows:
1. I need to display the <name> and <email> fields in my Repeater
HeaderTemplate.
2. In my Repeater ItemTemplate I want to display the last 4 <item>
records. 3. In my Repeater FooterTemplate I want to place my navigation
buttons "Previous", "Next".

Can someone help me?

Thank You,
Miguel
 
G

Guest

Hello
I guess it is better to :
1. Create data table and add AutoIncrement column.
2. Fill the data table from XML.
3. Create two variable to hold the value of record range you want to
display, the intial vlaue should be: var1=1, var2=4
4. Create DataView to sort data and select record where id =>var1 and =<var2
5. save the value of these two variable in a viewstate.
6. bind DataView to Repeator.
7. when Next button clicked add 4 to each variable (var1, var2) and re-bind.

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,279
Latest member
LaRoseDermaBottle

Latest Threads

Top