DataBinder.Eval ?
Jeg vil gerne have indholdet af min XML fil udskrevet i, men der kommer altid en fejl ...min xml ser sådan ud ?
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="http://www.newsfactor.com/rssstyle.css"?>
<rss version="2.0">
<channel>
<title>NewsFactor Network</title>
<link>http://www.newsfactor.com</link>
<description>Tech News by NewsFactor Network (http://www.newsfactor.com).</description>
<language>en-us</language>
<copyright>Copyright © 2005 NewsFactor Network, Inc.</copyright>
<managingEditor>editorial@newsfactor.com</managingEditor>
<webMaster>webmaster@newsfactor.com</webMaster>
<pubDate>Wed, 15 Jun 2005 15:45:11 -0500</pubDate>
<lastBuildDate>Wed, 15 Jun 2005 15:45:11 -0500</lastBuildDate>
<category>NewsFactor Network News</category>
.................
Min kode ser sådan ud
protected System.Data.DataSet dataSet1;
protected System.Web.UI.WebControls.Repeater Newz;
dataSet1.ReadXml(MapPath("XMLFile.xml"));
Newz.DataSource = dataSet1;
Newz.DataBind();
det jeg har sat ind i HTML'en ser sådan ud
<%@ Import Namespace="System.Data" %>
<form runat="server">;
<table border="1" width="20%">
<asp:repeater id="Newz" runat="server">
<HeaderTemplate>
<tr>
<th>Title</th>
<th>link</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container.DataItem,"title")%></td>
<td><%#DataBinder.Eval(Container.DataItem,"link")%></td>
</tr>
</ItemTemplate>
</asp:repeater>
</table>
</form>
Jeg får denne fejl
System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name title.
Hvad er fejlen ? Håber der er en der kan hjælpe :-)