Rank: Newbie Groups: Member
Joined: 2/26/2009 Posts: 1
|
I need to show one particular treenode based on the type of user viewing the page. I have this working with the code below but I don't want to use indexes since they will change when I insert a new node in the tree. How can I work around this?
if (HttpContext.Current.User.IsInRole("Financial")) { EO.Web.TreeNode node = tv_ReportsTree.TopGroup.Nodes[2].ChildNodes[6]; node.Visible = true; }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You don't need to do that. All you need to do is to set the TreeNode's AllowRoles property: http://doc.essentialobjects.com/library/1/eo.web.navigationitem.allowroles.aspxThanks!
|