Welcome Guest Search | Active Topics | Sign In | Register

Setting Menu item visible true and false dynamically Options
Silver Soler
Posted: Tuesday, February 12, 2008 1:58:11 PM
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
}

}
eo_support
Posted: Tuesday, February 12, 2008 2:06:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.