473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to create this ASP:Repeater?

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
Nov 19 '05 #1
1 1180
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
"Shapper" wrote:
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joe Fawcett | last post by:
I'm having a problem binding an asp:repeater control to a Hashtable. Originally my code was: <asp:Repeater id="rptFamily" runat="server" DataSource="<%# family %>"> <ItemTemplate> <%#...
2
by: Peter Kirk | last post by:
Hi are there any "gotchas" with using an asp:repeater that means that the "onclick" method of a LinkButton created in the repaeter does not fire? I at least cannot get it to work. I have a...
5
by: Scott Lyon | last post by:
I am having a strange problem. The program is a bit complex, but I'll try to simplify what I can. I apologize if this is complicated, but I think this would still be simpler than posting a bunch of...
3
by: John Giblin | last post by:
I have an asp repeater control which I am trying to assign the datasorce to it inline. Here is my code. <asp:Repeater ID="AddOnList" DataSource="<%#...
3
by: Kelly Leahy | last post by:
I'm using an Asp:Repeater control with a text box in the item templates. This is for a system that has a number of items that the user can edit and I'd like to generate them based on a list. ...
8
by: dhnriverside | last post by:
Hi I'm using an asp:repeater and its DataSource/DataBind system to show a number of records from the database. I want to highlight the latest record (which will be the highest ID). Any...
3
by: Joe Fawcett | last post by:
Sorry about the multi post, I thought I'd sent to both groups simultaneously but somehow it failed to find this one the first time. I'm having a problem binding an asp:repeater control to a...
1
by: Fred Dag | last post by:
As far as I can work out when using the OnTextChanged event I cannot get the TextBox and Labels values when the event fires as they are populated by a <asp:repeater and so don't have values. If...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
2
by: bissatch | last post by:
Hi, I am trying to output a list of checkboxes. Using ASP .NET controls, I was able to create the following: <label for="colour_red">Red: </label><asp:CheckBox ID="colour_red" runat="server"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.