Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Populating the Menu Control using XML

Populating the Menu Control using XML

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomxmlhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pogowolf
    wrote on last edited by
    #1

    :confused: Hey all, I'm trying to populate the menu control with a custom XML file. The XML is a basic Menu Style layout (hiaracy wise), with 3 parameters on each MenuItem entry: Label, URL, and Permission. Where Label is what is to be displayed on the menu, URL is the link, and Permission is the permissons level. The idea is to read in the XML file, add a new menu item, and then add it to the menu. Problem is.. nothing displays. So I know I'm doing something wrong. What I'm looking for is Sample code that would take this XML snippet. Which I can't post.. So I hope you get the idea here:

    Menu
    MenuItem Label="Home" URL=""
    MenuItem Label="Customers" URL=""
    MenuItem Label="Enter New" URL="CustEntry.aspx" Permission="EntCust
    MenuItem Label="Review" URL="Status.aspx" Permission="StatCust"
    MenuItem Label="Registration" URL="Reg.aspx" Permission="RegSubt"
    MenuItem
    Menu

    Menu Layout would be: Home | Customers |
    Enter New
    Review
    Registration

    and some how dump it into the ASP.NET 2.0 Menu control... :confused: or even just sample code of HOW to dump NON siteMap XML into the Menu control would be a God send. -== The PogoWolf ==- http://www.pogowolf.com GamersVue: http://GamersVue.blogger.com -- modified at 15:27 Thursday 18th May, 2006

    M 1 Reply Last reply
    0
    • P pogowolf

      :confused: Hey all, I'm trying to populate the menu control with a custom XML file. The XML is a basic Menu Style layout (hiaracy wise), with 3 parameters on each MenuItem entry: Label, URL, and Permission. Where Label is what is to be displayed on the menu, URL is the link, and Permission is the permissons level. The idea is to read in the XML file, add a new menu item, and then add it to the menu. Problem is.. nothing displays. So I know I'm doing something wrong. What I'm looking for is Sample code that would take this XML snippet. Which I can't post.. So I hope you get the idea here:

      Menu
      MenuItem Label="Home" URL=""
      MenuItem Label="Customers" URL=""
      MenuItem Label="Enter New" URL="CustEntry.aspx" Permission="EntCust
      MenuItem Label="Review" URL="Status.aspx" Permission="StatCust"
      MenuItem Label="Registration" URL="Reg.aspx" Permission="RegSubt"
      MenuItem
      Menu

      Menu Layout would be: Home | Customers |
      Enter New
      Review
      Registration

      and some how dump it into the ASP.NET 2.0 Menu control... :confused: or even just sample code of HOW to dump NON siteMap XML into the Menu control would be a God send. -== The PogoWolf ==- http://www.pogowolf.com GamersVue: http://GamersVue.blogger.com -- modified at 15:27 Thursday 18th May, 2006

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      There are two options which you can try: + You can manually build the MenuItem collection of the Menu control based on the XML data. + You may try with the XmlDataSource[^] control.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups