Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Due to security issue i need to hide my 2 menus when i used the below code the second one is hiding and third is showing. please advice

SQL
Menu1.Items.Item(0).Enabled = True
Menu1.Items.Remove(Menu1.Items.Item(1))
Menu1.Items.Remove(Menu1.Items.Item(2))
Posted
Comments
[no name] 2-Jul-12 7:45am    
You need to clarify your question. This is not ASP code and Remove <> hiding. What is it that you are trying to do?
ZurdoDev 2-Jul-12 8:14am    
Some collections update immediately as you are removing items from them so try removing in reverse order. Remove item 2, then item 1 and see what happens.

1 solution

I think you need to modify your code like this:
VB
Menu1.Items.Item(0).Enabled = True
Menu1.Items.Remove(Menu1.Items.Item(1))

AS item2 becomes item1 now
Menu1.Items.Remove(Menu1.Items.Item(1))
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900