473,785 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlDataSource or DataSetDataSour ce

I have a code below i'm trying to test
It had a DataSetDatasour ce 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:XmlDataSou rce ID="DataSetData Source1" Runat="server"
DataFile="~/data/Announcements.x ml"/>

<asp:DataList ID="DataList1" Runat="server"
DataSourceID="D ataSetDataSourc e1">

<ItemTemplate >

<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">

<tr>

<td valign="top" style="width: 80%">

<asp:HyperLin k ID="TitleLabel " Runat="server" NavigateUrl='<% #
DataBinder.Eval (Container.Data Item, "url") %>'

Text='<%# DataBinder.Eval (Container.Data Item, "Title") %>'
Font-Names="verdana"

Font-Bold="True" Font-Size="8pt" ForeColor="#003 399" />

<br />

by

<asp:Label ID="OwnerLabel " Runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "Owner") %>'

ForeColor="#003 399" />

</td>

<td style="text-align: right" align="right" valign="top">

<asp:Label ID="DateLabel" Runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "Date") %>'

Font-Names="verdana" Font-Bold="True" Font-Size="8pt" ForeColor="#003 399" />

</td>

</tr>
<tr>

<td colspan="2">

<asp:Label ID="Description Label" Runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "Descriptio n") %>' />

</td>

</tr>

</table>

</ItemTemplate>

</asp:DataList>

----------------------------------------------

<?xml version="1.0" encoding="utf-8" ?>

<announcement s>

<announcement >

<id>1</id>

<title>New Intranet Portal Launched!</title>

<date>6/1/2003</date>

<owner>Star Developer</owner>

<description>Ou r 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>Presiden t</owner>

<description> We have decided to double eveyone's paycheck this month.
Enjoy!</description>

<url>~/default.aspx</url>

</announcement>

</announcements>


May 21 '07 #1
2 1844
On May 21, 10:27 am, "rote" <naijaco...@hot mail.comwrote:
I have a code below i'm trying to test
It had a DataSetDatasour ce 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:XmlDataSou rce ID="DataSetData Source1" Runat="server"
DataFile="~/data/Announcements.x ml"/>

<asp:DataList ID="DataList1" Runat="server"
DataSourceID="D ataSetDataSourc e1">

<ItemTemplate >

<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">

<tr>

<td valign="top" style="width: 80%">

<asp:HyperLin k ID="TitleLabel " Runat="server" NavigateUrl='<% #
DataBinder.Eval (Container.Data Item, "url") %>'

Text='<%# DataBinder.Eval (Container.Data Item, "Title") %>'
Font-Names="verdana"

Font-Bold="True" Font-Size="8pt" ForeColor="#003 399" />

<br />

by

<asp:Label ID="OwnerLabel " Runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "Owner") %>'

ForeColor="#003 399" />

</td>

<td style="text-align: right" align="right" valign="top">

<asp:Label ID="DateLabel" Runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "Date") %>'

Font-Names="verdana" Font-Bold="True" Font-Size="8pt" ForeColor="#003 399" />

</td>

</tr>

<tr>

<td colspan="2">

<asp:Label ID="Description Label" Runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "Descriptio n") %>' />

</td>

</tr>

</table>

</ItemTemplate>

</asp:DataList>

----------------------------------------------

<?xml version="1.0" encoding="utf-8" ?>

<announcement s>

<announcement >

<id>1</id>

<title>New Intranet Portal Launched!</title>

<date>6/1/2003</date>

<owner>Star Developer</owner>

<description>Ou r 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>Presiden t</owner>

<description> We have decided to double eveyone's paycheck this month.
Enjoy!</description>

<url>~/default.aspx</url>

</announcement>

</announcements>
This should work

<asp:XmlDataSou rce ID="DataSetData Source1" Runat="server"
DataFile="~/data/Announcements.x ml" XPath="announce ments/
announcement" />

<asp:DataList ID="DataList1" runat="server"
DataSourceID="D ataSetDataSourc e1">
<ItemTemplate >
<table id="Table1" cellspacing="1" cellpadding="1"
width="100%" border="0">
<tr>
<td valign="top" style="width: 80%">
<asp:HyperLin k ID="TitleLabel "
runat="server" NavigateUrl='<% # XPath("url") %>' Text='<%#
XPath("title") %>' Font-Names="verdana"
Font-Bold="True" Font-Size="8pt"
ForeColor="#003 399" />
<br />
by
<asp:Label ID="OwnerLabel "
runat="server" Text='<%# XPath("owner") %>' ForeColor="#003 399" />
</td>
<td style="text-align: right"
align="right" valign="top">
<asp:Label ID="DateLabel"
runat="server" Text='<%# XPath("date") %>' Font-Names="verdana" Font-
Bold="True" Font-Size="8pt" ForeColor="#003 399" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Description Label"
runat="server" Text='<%# XPath("descript ion") %>' />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>

May 21 '07 #2
Thanks alot
"Alexey Smirnov" <al************ @gmail.comwrote in message
news:11******** **************@ x35g2000prf.goo glegroups.com.. .
On May 21, 10:27 am, "rote" <naijaco...@hot mail.comwrote:
>I have a code below i'm trying to test
It had a DataSetDatasour ce 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:XmlDataSo urce ID="DataSetData Source1" Runat="server"
DataFile="~/data/Announcements.x ml"/>

<asp:DataLis t ID="DataList1" Runat="server"
DataSourceID=" DataSetDataSour ce1">

<ItemTemplat e>

<table id="Table1" cellspacing="1" cellpadding="1" width="100%"
border="0">

<tr>

<td valign="top" style="width: 80%">

<asp:HyperLi nk ID="TitleLabel " Runat="server" NavigateUrl='<% #
DataBinder.Eva l(Container.Dat aItem, "url") %>'

Text='<%# DataBinder.Eval (Container.Data Item, "Title") %>'
Font-Names="verdana"

Font-Bold="True" Font-Size="8pt" ForeColor="#003 399" />

<br />

by

<asp:Label ID="OwnerLabel " Runat="server" Text='<%#
DataBinder.Eva l(Container.Dat aItem, "Owner") %>'

ForeColor="#00 3399" />

</td>

<td style="text-align: right" align="right" valign="top">

<asp:Label ID="DateLabel" Runat="server" Text='<%#
DataBinder.Eva l(Container.Dat aItem, "Date") %>'

Font-Names="verdana" Font-Bold="True" Font-Size="8pt" ForeColor="#003 399"
/>

</td>

</tr>

<tr>

<td colspan="2">

<asp:Label ID="Description Label" Runat="server" Text='<%#
DataBinder.Eva l(Container.Dat aItem, "Descriptio n") %>' />

</td>

</tr>

</table>

</ItemTemplate>

</asp:DataList>

----------------------------------------------

<?xml version="1.0" encoding="utf-8" ?>

<announcements >

<announcemen t>

<id>1</id>

<title>New Intranet Portal Launched!</title>

<date>6/1/2003</date>

<owner>Star Developer</owner>

<description>O ur new Company Intranet Portal has launched! Be sure to
check
out the ultra cool personalization abilities.</description>

<url>~/sales.aspx</url>

</announcement>

<announcemen t>

<id>2</id>

<title>Top Customers Identified</title>

<date>6/1/2003</date>

<owner>Sales Manager</owner>

<description>W e have identified our top customers based on orders placed.
Check out the Sales tab for more details.</description>

<url>~/default.aspx</url>

</announcement>

<announcemen t>

<id>3</id>

<title>Pay Day</title>

<date>5/15/2003</date>

<owner>Preside nt</owner>

<description>W e have decided to double eveyone's paycheck this month.
Enjoy!</description>

<url>~/default.aspx</url>

</announcement>

</announcements>

This should work

<asp:XmlDataSou rce ID="DataSetData Source1" Runat="server"
DataFile="~/data/Announcements.x ml" XPath="announce ments/
announcement" />

<asp:DataList ID="DataList1" runat="server"
DataSourceID="D ataSetDataSourc e1">
<ItemTemplate >
<table id="Table1" cellspacing="1" cellpadding="1"
width="100%" border="0">
<tr>
<td valign="top" style="width: 80%">
<asp:HyperLin k ID="TitleLabel "
runat="server" NavigateUrl='<% # XPath("url") %>' Text='<%#
XPath("title") %>' Font-Names="verdana"
Font-Bold="True" Font-Size="8pt"
ForeColor="#003 399" />
<br />
by
<asp:Label ID="OwnerLabel "
runat="server" Text='<%# XPath("owner") %>' ForeColor="#003 399" />
</td>
<td style="text-align: right"
align="right" valign="top">
<asp:Label ID="DateLabel"
runat="server" Text='<%# XPath("date") %>' Font-Names="verdana" Font-
Bold="True" Font-Size="8pt" ForeColor="#003 399" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Description Label"
runat="server" Text='<%# XPath("descript ion") %>' />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>

May 22 '07 #3

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

Similar topics

0
464
by: W. Kacy | last post by:
I am having trouble using XML in an ASP.NET 2.0 webform. Using ASP.NET 2.0 beta 2, I have created a blank web page in a C# website. I have added an XML file (soData.xml), structured as follows: <?xml version = "1.0" encoding="Windows-1252" standalone="yes"?> <VFPData> <ac_sodata> <iono>Vendor</iono> <sodate>2004-03-04</sodate> <sono>164</sono>
2
3168
by: mike | last post by:
can somebody please show me some code that will let me populate a checkboxlist from the xmldatasource, and have the text property set to the names in the xml file thanks you can also email me at i_am_the_freshmaka@hotmail.com
3
9170
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't really had any success. I'm pretty sure I should be casting my XPathSelect() call to something so I can get at its attributes. This seems like it should be easy, and maybe I'm missing something obvious. Does anyone have any ideas? Here is the...
2
2683
by: Zulander | last post by:
hi, i am trying to put a session variable in the DataFile of the XmlDataSource, but for some reason i am getting: Server tags cannot contain <% ... %constructs. <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="<% Session("UserPath") %"></asp:XmlDataSource> I have even tried this: <asp:XmlDataSource ID="XmlDataSource1" runat="server"
2
7457
by: sck10 | last post by:
Hello, How do you set the website proxy using the XmlDataSource control? Thanks, sck10
1
3175
by: Disccooker | last post by:
i am trying to use XPath and the XMLDataSource to display data from an XMLDocument and am getting nowhere. What i would like to do is have a repeater display a label for Seed, label for Team Name and a Text Box for each game - like an NCAA bracket. 1. Team1 16. Bradley 8. Missouri 9. USM
0
1764
by: pompair | last post by:
Hello, I'm making a quiz game for fun. I have an xml file like this: <?xml version="1.0" encoding="utf-8" ?> <results> <index>99</index> <answers>11</answers> <questions> <question id="1">
8
2071
by: Wessel Troost | last post by:
We are using an XML data source in the Page_Load event of an ASP.NET page, like: protected void Page_Load(object sender, EventArgs e) { // Retrieve XML from web service for product idea in URL string sXML = GetXmlFromWebService(Request); XmlDataSource ds = new XmlDataSource(); ds.Data = sXML;
1
1813
by: Sean | last post by:
I am experiencing a strange problem using the XMLDataSource and DataList controls which I cannot seem to resolve. I am using the controls to read and display a variety of RSS feeds. On my local machine everything runs fine and the latest data is downloaded and displayed correctly. On the remote server this was also running fine but since a few days ago the controls will only show old data even though I know the feeds have been updated. The...
0
9481
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10095
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9954
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.