Bind XML datasource to Menu

Discussion in 'ASP .Net Web Controls' started by dvomsaal@ddrtech.com, Mar 20, 2007.

  1. Guest

    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
    , Mar 20, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2VubmV0aA==?=

    Easiest way to bind a grid datasource to a datatable

    =?Utf-8?B?S2VubmV0aA==?=, Jan 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    6,726
    =?Utf-8?B?S2VubmV0aA==?=
    Jan 18, 2004
  2. Luke Dalessandro
    Replies:
    2
    Views:
    4,549
    Luke Dalessandro
    Sep 28, 2004
  3. =?Utf-8?B?bWltbw==?=

    Bind a Label to an object Datasource control

    =?Utf-8?B?bWltbw==?=, Jan 3, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,926
    =?Utf-8?B?bWltbw==?=
    Jan 3, 2006
  4. Kevin

    Object datasource bind problem

    Kevin, Aug 26, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    501
    Kevin
    Aug 26, 2006
  5. wardemon
    Replies:
    0
    Views:
    965
    wardemon
    Nov 30, 2006
Loading...

Share This Page