create an entity class with menu and sub menu relalted logic, that work as model.
public int Id { get; set; }
public string Name { get; set; }
public string Action { get; set; }
public string Controller { get; set; }
public List<Menu> SubMenu { get; set; }
In controller you have to add one method in your base class.This base class should be exectued by each and every pages of your application.
public ActionResult MenuBar()
{
var menuItems = from t in dbContext.GetMenuItem(Session["LoggedInID"])
select t;
return PartialView("Menubar", menuItems);
}
create one basePage that inherited by every controller.
and then finally create one view that need to put in Layout.cshtml page.
@Html.Action("Menubar");
and In View you have to put loop for your model and will create relavant html to load your menu based on your desing.