Binding DataList to XML

P

paulsmith5

Hi,

I'm trying to bind a datalist to an XML file to create a menu bar of
sorts. The XML file contains a list of menu items grouped into two main
topic areas see below:

<TOPICLIST TYPE="MenuItems">
<TOPICS TYPE="Type1">
<TOPIC>
<TITLE>Menu 1</TITLE>
<URL>somewhere.aspx</URL>
</TOPIC>
<TOPIC>
<TITLE>Menu 2</TITLE>
<URL>somewhere.aspx</URL>
</TOPIC>
<TOPIC>
<TITLE>Menu 3</TITLE>
<URL>somewhere.aspx</URL>
</TOPIC>
</TOPICS>
<TOPICS TYPE="Type2">
<TOPIC>
<TITLE>Menu 4</TITLE>
<URL>somewhere.aspx</URL>
</TOPIC>
<TOPIC>
<TITLE>Menu 5</TITLE>
<URL>somewhere.aspx</URL>
</TOPIC>
<TOPIC>
<TITLE>Menu 6</TITLE>
<URL>somewhere.aspx</URL>
</TOPIC>
</TOPICS>
</TOPICLIST>

What I'd like to do is to bind a datalist to either those topics of
type Type1 or Type2. At any one time the datalist should show Menu1,
Menu2 and Menu3 or Menu4, Menu4 and Menu6. My datalist comprises of a
linkbutton ItemTemplate and I'm hoping to set the text of the button to
the TITLE in the XML file. Hope someone can help.

Thanks,

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,786
Messages
2,569,626
Members
45,323
Latest member
XOBJamel3

Latest Threads

Top