<menuMapNode title="User Defined Code #1" action="Index" controller="UserCodes1" area="Reservations" icon="" roles="T_USERCOD1" /> <menuMapNode title="User Defined Code #2" action="Index" controller="UserDefinedCode2" area="Reservations" icon="" roles="*" />The problem for this particular part of the menu that the title should not be really 'User Defined Code #'. This title should be read from a database.
private List<MainMenuListItem> BuildMenuItemTreeFromMapNodeTree(MenuMapNode menuMapNode, string opCode) { // Recursively build a tree of MainMenuListItems from a MenuMapNode tree (the MenuMapNode // tree is a tree of nodes representing a hierarchical menu map). The MainMenuListItems tree // will be trimmed according to the users's roles and can be used to build a menu in the UI. var query = (from mapNode in menuMapNode.SubNodes select new MainMenuListItem(mapNode.Roles) { Text = mapNode.Title, NavigateUrl = _UrlHelper.Action(mapNode.Action, mapNode.Controller, new { area = mapNode.Area }), Icon = mapNode.Icon, Children = BuildMenuItemTreeFromMapNodeTree(mapNode, opCode), AreaName = mapNode.Area, ControllerName = mapNode.Controller, ActionName = mapNode.Action }).Where(menuItem => menuItem.IsRoleMatch(_UsersRoles, opCode)).ToList(); return query; }So, one possibility I see here is to change