Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / March 2007

Tip: Looking for answers? Try searching our database.

Binding ASP.NET Menu to XML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dvomsaal@ddrtech.com - 19 Mar 2007 22:04 GMT
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 = "/*/*"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.