private void PopulateMenus() { IEnumerable <FitnessManagement.Data.Menu> menus = securityProvider.GetAllMenus(null); foreach (FitnessManagement.Data.Menu menu in menus) { MenuItem menuItem = new MenuItem(menu.Title, menu.ID.ToString()); menuItem.NavigateUrl = "~/" + menu.NavigationTo; PopulateChildMenu(menuItem, menu.ID); menuDefault.Items.Add(menuItem); } }