473,670 Members | 2,228 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datalist with an xml file

How do I get all the name(s) listed in the datalist?

<asp:DataList ID="DataList1" runat="server" DataSourceID="X mlDataSource1">

<ItemTemplate >

<table>

<tr>

<td><%# XPath("Name")%> </td>

</tr>

</table>

</ItemTemplate>

</asp:DataList>

<asp:XmlDataSou rce ID="XmlDataSour ce1" runat="server" DataFile="~/Query1.xml" XPath="Donors">

</asp:XmlDataSour ce>

<Donors>

<Name >

Abigail Sears

</Name>

<Name >

Alicia &amp; Joe Swindel

</Name>

<Name >

Alissa &amp; Neal Keny-Guyer

</Name>

<Name >

Ann Bremer &amp; Earl Molander

</Name>

....

</Donors>

Feb 20 '06 #1
3 1515


Aaron wrote:
How do I get all the name(s) listed in the datalist? <Donors>

<Name >

Abigail Sears

</Name>

<Name >

Alicia &amp; Joe Swindel

</Name>

<Name >

Alissa &amp; Neal Keny-Guyer

</Name>

<Name >

Ann Bremer &amp; Earl Molander

</Name>

...

</Donors>


This is one way to do it (.NET 2.0):

<asp:XmlDataSou rce
ID="XmlDataSour ce1"
runat="server"
DataFile="test2 006022001.xml" XPath="Donors/Name"></asp:XmlDataSour ce>

<asp:DataList id="MyDataList " DataSourceId="X mlDataSource1" runat="server">
<ItemTemplate >
<%# XPath(".") %>
</ItemTemplate>
</asp:DataList>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Feb 20 '06 #2
Martin,

Thanks,

my next question is this:
How do you get this datalist more like a grided table of 3 columns?
Here is what I have but it is not in true columns.
<asp:DataList ID="DataList1" runat="server" BorderColor="#0 06699"
DataSourceID="X mlDataSource1"

GridLines="Both " ShowFooter="Fal se" ShowHeader="Fal se" BackColor="Whit e"
Font-Bold="False" Font-Italic="False" Font-Overline="False "
Font-Strikeout="Fals e" Font-Underline="Fals e" RepeatColumns=" 3"
RepeatDirection ="Horizontal ">

<ItemTemplate>< %# XPath(".")%></ItemTemplate>

</asp:DataList>

Aaron Minoo
"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:eD******** ******@tk2msftn gp13.phx.gbl...


Aaron wrote:
How do I get all the name(s) listed in the datalist?
<Donors>

<Name >

Abigail Sears

</Name>

<Name >

Alicia &amp; Joe Swindel

</Name>

<Name >

Alissa &amp; Neal Keny-Guyer

</Name>

<Name >

Ann Bremer &amp; Earl Molander

</Name>

...

</Donors>


This is one way to do it (.NET 2.0):

<asp:XmlDataSou rce
ID="XmlDataSour ce1"
runat="server"
DataFile="test2 006022001.xml" XPath="Donors/Name"></asp:XmlDataSour ce>

<asp:DataList id="MyDataList " DataSourceId="X mlDataSource1"

runat="server"> <ItemTemplate >
<%# XPath(".") %>
</ItemTemplate>
</asp:DataList>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Feb 20 '06 #3

Aaron wrote:
my next question is this:
How do you get this datalist more like a grided table of 3 columns?


The XML specific problem is solved then I think, for presentational
aspects of the ASP.NET DataList consider asking in an ASP.NET group.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Feb 20 '06 #4

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

Similar topics

4
3240
by: Chad | last post by:
Hello, Im new to c++ and want to know how i can remove \n from a file. Im used to php where it is very easy to do. Im trying to remove the \n from a html file if that makes any difference. Thanks for any help.
0
3100
by: Alex | last post by:
Interested in more .NET stuff visit www.dedicatedsolutions.co.uk The DataList is not as powerful as the DataGrid. It requires more work from you since it has no default data presentation format. However, the DataGrid begins to get very cumbersome as the number of columns of data you present increases. Anything more than half a dozen columns or so and you probably induce horizontal scrolling - a real no-no for me. If you put such a...
2
3436
by: Hans Merkl | last post by:
Hi, I am trying to use a user control as EditItemTemplate in a DataList. It loads fine but I can't figure out how to bind to the data of the DataList. Here is what I have got so far: //Page_load of my user control protected void Page_Load(object sender, EventArgs e) { IDataItemContainer DataContainer = this.Parent as
0
3937
by: Isz | last post by:
PROBLEM: This problem is related to the postback and handling events correctly. BACKGROUND: I have a datalist which acts as a tabbes list with horizontal layout. This datalist is bound to a strogly typed collection I called TabCollection which is a collevtion of items called tab. Each tab is as follows:
0
1642
by: Les Caudle | last post by:
I have a menu system composed of a DataList nested inside a DataList. The outer DataList has it's DataSource (composed of a DataSet with two tables linked by a CategoryPagesRelation Relation) set in the Page_Load. The inner DataList has its DataSource set in the ascx file as: <asp:DataList ID="PageList" runat="server" CellPadding="3" CellSpacing="0" DataSource='<%#...
4
2796
by: Nathan Sokalski | last post by:
I have a DataList that has an Button as one of the controls in it's ItemTemplate. The Button has a CommandName="delete" attribute, but when I click it the DeleteCommand event doesn't even get fired. I have checked everything I could think of, but everything looks correct to me. Here is the relevant code from the *.aspx file and the *.aspx.vb files (if I missed something that is relevant, let me know): ASPX File:
2
6446
by: farhad13841384 | last post by:
Hi , I Hope You fine. I have some problem with this code for paging in asp.net this bottom code work correctly without any error but when I try to place separate code in .VB file then error is begin and occured .I want to separate this code and compiling .vb code using VBC.exe later .(bin/paging.dll) when do it like me so you retrive only < Previous Page Next Page > in your web browser and you don't retrive list Of data in your web browser....
2
1638
by: David C | last post by:
I have a DataList control that shows jpg and gif images just fine. I am filling the DataList from a list of files in a directory. The directory might contain tif and pdf files but all that shows in the DataList is the red X for these files. Am I asking it to do something that is not possible? If not, are there any alternatives to showing a reduced image for other file types in a DataList? Thanks. My DataList control is shown below. ...
3
2805
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I need to control the visibility of a textbox based on a dropdown selection in the datalist's edititem template. To do this, I registered a client script block function and attached a client side handler for the dropdownlist's onchange event in the...
3
3212
by: sara10 | last post by:
hi, i have a datalist inside a tabcontainer. I need to display data from database into the datalist as hyperlink, and when i click on any of that link it should navigate to another page and to display data according to that link. i have tried and it works fine when the datalist is not placed inside the tabcontainer, but when i put datalist inside tab container the "OnItemdatabound " event does't fire. here is the code....
0
8386
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
8814
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8592
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,...
1
6213
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
5684
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
4211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2800
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
2042
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.