Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Controlling items visibility in menu control

Reply
Thread Tools

Controlling items visibility in menu control

 
 
Vipper
Guest
Posts: n/a
 
      06-26-2007
Hi,

I'd like to control the item visibility of a menu control, but I cannot find
the visibility property of the item.
The idea is like this:

if [...]
mnuOptions.items(1).visible = false
end if

Is it possible?

Thanks
 
Reply With Quote
 
 
 
 
Vipper
Guest
Posts: n/a
 
      06-27-2007
Thanks David. It's exactly what i need.


"David R. Longnecker" wrote:

> I believe the syntax you are looking for is Menu.Items.RemoveAt(int). Here's
> an example of both greying out an item and removing it from the collection
> (ala Hiding it).
>
> Menu1.Items.Add(new MenuItem("Menu #1", "", "", "~/default.aspx",
> "_parent")); // [0]
> Menu1.Items.Add(new MenuItem("Menu #2", "", "", "~/default.aspx",
> "_parent")); // [1]
> Menu1.Items.Add(new MenuItem("Menu #3", "", "", "~/default.aspx",
> "_parent")); // [2]
> Menu1.Items.Add(new MenuItem("Menu #4", "", "", "~/default.aspx",
> "_parent")); // [3]
> Menu1.Items.Add(new MenuItem("Menu #5", "", "", "~/default.aspx",
> "_parent")); // [4]
>
> Menu1.Items[1].Enabled = false; // Greys out Menu #2.
>
> Menu1.Items.RemoveAt(2); // Removes Menu #3 from the MenuItemCollection
>
> I'm assuming the VB syntax would be the same, just without the semi-colons
> for the RemoveAt.
>
> if [...]
>
> mnuOptions.Items.RemoveAt(1)
>
> end if.
>
> etc.
>
> HTH.
>
> -dl
>
> --
> David R. Longnecker
> http://blog.tiredstudent.com
>
> V> Hi,
> V>
> V> I'd like to control the item visibility of a menu control, but I
> V> cannot find
> V> the visibility property of the item.
> V> The idea is like this:
> V> if [...]
> V> mnuOptions.items(1).visible = false
> V> end if
> V> Is it possible?
> V>
> V> Thanks
> V>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Menu Items and Child Menu Items Larry Bud ASP .Net 13 01-07-2008 02:12 PM
Horizontal Menu Navigation Web Control - Spaces Between Menu Items Philip ASP .Net Web Controls 1 03-21-2006 01:55 PM
Iterating through all the menu/child items in a menu control Bryan ASP .Net 1 03-01-2006 09:38 AM
Adding Access keys to menu items in the Menu control Mike Tavares ASP .Net Web Controls 2 01-05-2006 11:06 AM
Problem with controlling visibility of linkbutton =?Utf-8?B?TWFubnkgQ2hvaGFu?= ASP .Net 6 04-05-2005 06:00 PM



Advertisments