Bind XML datasource to Menu

D

dvomsaal

I have created a XmlDocument that contains the exact layout that
siteMap uses, and then I bind my Menu object to it:

Dim xml As XmlDocument
xml = DirectCast(Session("MenuData"), XmlDocument)


Dim xmlDS As New XmlDataSource()
xmlDS.Data = xml.OuterXml


MainMenu.DataSource = xmlDS
Dim mb As New MenuItemBinding()
mb.DataMember = "SiteMapNode"
mb.TextField = "Title"
mb.NavigateUrlField = "url"


MainMenu.DataBindings.Add(mb)
MainMenu.DataBind()


The problem is when it displays it always shows the root element
("siteMap"). If you use a static site map you have an option to turn
this off; am I missing the ability to do that since I'm using XML?


Thanks,
DvS
 

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

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top