Rank: Newbie Groups: Member
Joined: 11/24/2008 Posts: 5
|
Dear all,
I want to reference a session variable in my .aspx page from inside <eo> tag. The reason is that I want to make invisible a menu option based on a value of a session variable.
How can I achieve this ?
Any assistance is kindly appreciated
Thanks
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You should do it in code behind instead of doing it inside .aspx. It will be something like this:
Code: C#
//Find the menu item you wish to modify
EO.Web.MenuItem item = Menu1.Items[0];
//Modify the menu item based on whatever condition
if (Session["something"] == "whatever")
item.Visible = false;
The key at here is to find the correct menu item you want to modify. The code above modifies the first menu item. You can also use syntax like "Menu1.Items[0].SubItems[0]" to modify the child items, or call FindItem or SearchItems method to locate the item: http://doc.essentialobjects.com/library/1/eo.web.basenavigator.finditem.aspxhttp://doc.essentialobjects.com/library/1/eo.web.basenavigator.searchitems_overloads.aspxThanks!
|