SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2008
    Location
    Olongapo City
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hiding asp.net menu Items

    I need to hide some of my menu items, but I dont know how.

    I get the data from a web.siteMap xml file and since it is a site Map, I have included all the pages in my website. Problem is, some of those pages need a querystring to properly function; and I dont want to have to tell the user that he's on the wrong page because he clicked an Item from the menu which he shouldnt have. So I decide to hide those pages.

    Can someone tell me how?

  2. #2
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Catch the MenuItemDataBound event and then using whatever logic you choose make it visible/not visible.

    http://msdn.microsoft.com/en-us/libr...nd(VS.80).aspx

    HTH
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel

  3. #3
    SitePoint Member
    Join Date
    Dec 2008
    Location
    Olongapo City
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the post,

    I deleted the menu items like this.

    Code:
    If e.Item.Text = ("Bill Editor") Or _
               e.Item.Text = ("Cancel Bill") Or _
               e.Item.Text = ("Cancel Payment") Or _
               e.Item.Text = ("Payment Record") Or _
               e.Item.Text = ("Billing Statement") Or _
               e.Item.Text = ("Edit Account") Then
                e.Item.Parent.ChildItems.Remove(e.Item)
    End If
    I hope this helps others as well.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •