Welcome Guest Search | Active Topics | Sign In | Register

Reference a Session variable fron eo.web menu Options
John Fotiadis
Posted: Thursday, June 4, 2009 7:09:47 AM
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
eo_support
Posted: Thursday, June 4, 2009 8:40:53 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,084
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.aspx
http://doc.essentialobjects.com/library/1/eo.web.basenavigator.searchitems_overloads.aspx

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.