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. Advertisements

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,994
    =?Utf-8?B?S2VubmV0aA==?=
    Jan 18, 2004
  2. Luke Dalessandro
    Replies:
    2
    Views:
    4,727
    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:
    2,057
    =?Utf-8?B?bWltbw==?=
    Jan 3, 2006
  4. Kevin

    Object datasource bind problem

    Kevin, Aug 26, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    582
    Kevin
    Aug 26, 2006
  5. wardemon
    Replies:
    0
    Views:
    1,161
    wardemon
    Nov 30, 2006
  6. Paul D. Fox

    Can I convet a query from an API into a Datasource to bind to?

    Paul D. Fox, Sep 9, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    258
    Paul D. Fox
    Sep 13, 2005
  7. Phil Streiff
    Replies:
    3
    Views:
    1,048
    Teemu Keiski
    Apr 25, 2004
  8. bisrael

    ASP.NET Newbie radiobuttonlist bind datasource

    bisrael, Feb 27, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    327
    Wilco Bauwer
    Feb 27, 2005
Loading...