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
dvomsaal@ddrtech.com - 20 Mar 2007 21:23 GMT
On Mar 19, 5:04 pm, dvoms...@ddrtech.com wrote:
> I have created a XmlDocument that contains the exact layout that
> siteMap uses, and then I bind my Menu object to it:
[quoted text clipped - 20 lines]
> Thanks,
> DvS
If anyone else is interested, the solution is to add the following
line:
xmlDS.XPath = "/*/*"