S
Shapper
Hello,
I have a XML which contains 2 data types:
1. Data which is not repeated. (<title>, <link>)
2. Repeating data. (<item>)
My XML File:
<channel>
<title>...</title>
<link>...</link>
<item>
<title>4 Web Version 1.0 is available since today!</title>
<link></link>
<description>...</description>
<pubDate>...</pubDate>
</item>
...
I was able to place data in (1) in the HeaderTemplate of my Repeater.
Now I need to place the repeating data in the ItemTemplate of my
Repeater.
I have this:
news.Load(Server.MapPath("xml/news.rss"))
rptNews.DataSource = news.SelectNodes("channel/item")
rptNews.DataBind()
It's not working. When I use <%# DataBinder.Eval(Container.DataItem,
"title") %> in my aspx code I get the error: DataBinder.Eval:
'System.Xml.XmlElement' does not contain a property with the name title.
I suppose I need to get the XML data into a dataset and then bind it to
my repeater. Is that right?
How can I solve this?
Thank You,
Miguel
I have a XML which contains 2 data types:
1. Data which is not repeated. (<title>, <link>)
2. Repeating data. (<item>)
My XML File:
<channel>
<title>...</title>
<link>...</link>
<item>
<title>4 Web Version 1.0 is available since today!</title>
<link></link>
<description>...</description>
<pubDate>...</pubDate>
</item>
...
I was able to place data in (1) in the HeaderTemplate of my Repeater.
Now I need to place the repeating data in the ItemTemplate of my
Repeater.
I have this:
news.Load(Server.MapPath("xml/news.rss"))
rptNews.DataSource = news.SelectNodes("channel/item")
rptNews.DataBind()
It's not working. When I use <%# DataBinder.Eval(Container.DataItem,
"title") %> in my aspx code I get the error: DataBinder.Eval:
'System.Xml.XmlElement' does not contain a property with the name title.
I suppose I need to get the XML data into a dataset and then bind it to
my repeater. Is that right?
How can I solve this?
Thank You,
Miguel