Rank: Newbie Groups: Member
Joined: 2/12/2008 Posts: 1
|
Hi Dear, I have the piece of code that set visible false or true. My problem is when I try to make visible = true the menu items don't became visible also there is not any error whatsoever.
Code: string strSystemGUID = Session["CurrentSystemGUID"].ToString(); if (strSystemGUID.Length < 5) {
Menu1.Items[4].Visible = false; //Revenue Menu1.Items[6].Visible = false; // Expense
} else { Menu1.Items[4].Visible = true; //Revenue Menu1.Items[6].Visible = true; // Expense }
}
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Silver,
Try to put a static menu in a blank page and then put in similar code in your Page_Load and see if that works (It should). Once you get that working, you can start to find out why it's not working in your current page. Most likely the code that you set the Visible is not executed at all, or it has been executed, and then some other code got executed again and turned it to invisible. Visible itself is fairly straight forward and should work fine.
Thanks
|