R
rote
I have a code below i'm trying to test
It had a DataSetDatasource but i thinks its deprecated if yes what can i use
in this scenario below?
I used XmlDatasource but its saying it can't find the property url in the
xml which is there
Any ideas?
** XML datasource file below
<asp:XmlDataSource ID="DataSetDataSource1" Runat="server"
DataFile="~/data/Announcements.xml"/>
<aspataList ID="DataList1" Runat="server"
DataSourceID="DataSetDataSource1">
<ItemTemplate>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td valign="top" style="width: 80%">
<asp:HyperLink ID="TitleLabel" Runat="server" NavigateUrl='<%#
DataBinder.Eval(Container.DataItem, "url") %>'
Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>'
Font-Names="verdana"
Font-Bold="True" Font-Size="8pt" ForeColor="#003399" />
<br />
by
<asp:Label ID="OwnerLabel" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Owner") %>'
ForeColor="#003399" />
</td>
<td style="text-align: right" align="right" valign="top">
<asp:Label ID="DateLabel" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Date") %>'
Font-Names="verdana" Font-Bold="True" Font-Size="8pt" ForeColor="#003399" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="DescriptionLabel" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Description") %>' />
</td>
</tr>
</table>
</ItemTemplate>
</aspataList>
----------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<announcements>
<announcement>
<id>1</id>
<title>New Intranet Portal Launched!</title>
<date>6/1/2003</date>
<owner>Star Developer</owner>
<description>Our new Company Intranet Portal has launched! Be sure to check
out the ultra cool personalization abilities.</description>
<url>~/sales.aspx</url>
</announcement>
<announcement>
<id>2</id>
<title>Top Customers Identified</title>
<date>6/1/2003</date>
<owner>Sales Manager</owner>
<description>We have identified our top customers based on orders placed.
Check out the Sales tab for more details.</description>
<url>~/default.aspx</url>
</announcement>
<announcement>
<id>3</id>
<title>Pay Day</title>
<date>5/15/2003</date>
<owner>President</owner>
<description>We have decided to double eveyone's paycheck this month.
Enjoy!</description>
<url>~/default.aspx</url>
</announcement>
</announcements>
It had a DataSetDatasource but i thinks its deprecated if yes what can i use
in this scenario below?
I used XmlDatasource but its saying it can't find the property url in the
xml which is there
Any ideas?
** XML datasource file below
<asp:XmlDataSource ID="DataSetDataSource1" Runat="server"
DataFile="~/data/Announcements.xml"/>
<aspataList ID="DataList1" Runat="server"
DataSourceID="DataSetDataSource1">
<ItemTemplate>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td valign="top" style="width: 80%">
<asp:HyperLink ID="TitleLabel" Runat="server" NavigateUrl='<%#
DataBinder.Eval(Container.DataItem, "url") %>'
Text='<%# DataBinder.Eval(Container.DataItem, "Title") %>'
Font-Names="verdana"
Font-Bold="True" Font-Size="8pt" ForeColor="#003399" />
<br />
by
<asp:Label ID="OwnerLabel" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Owner") %>'
ForeColor="#003399" />
</td>
<td style="text-align: right" align="right" valign="top">
<asp:Label ID="DateLabel" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Date") %>'
Font-Names="verdana" Font-Bold="True" Font-Size="8pt" ForeColor="#003399" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="DescriptionLabel" Runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Description") %>' />
</td>
</tr>
</table>
</ItemTemplate>
</aspataList>
----------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<announcements>
<announcement>
<id>1</id>
<title>New Intranet Portal Launched!</title>
<date>6/1/2003</date>
<owner>Star Developer</owner>
<description>Our new Company Intranet Portal has launched! Be sure to check
out the ultra cool personalization abilities.</description>
<url>~/sales.aspx</url>
</announcement>
<announcement>
<id>2</id>
<title>Top Customers Identified</title>
<date>6/1/2003</date>
<owner>Sales Manager</owner>
<description>We have identified our top customers based on orders placed.
Check out the Sales tab for more details.</description>
<url>~/default.aspx</url>
</announcement>
<announcement>
<id>3</id>
<title>Pay Day</title>
<date>5/15/2003</date>
<owner>President</owner>
<description>We have decided to double eveyone's paycheck this month.
Enjoy!</description>
<url>~/default.aspx</url>
</announcement>
</announcements>