I'm working in Asp.Net MVC, and I want to populate menu from database, but I don't really have an idea how can I do it to insert sub-menus into each menu, and each of this sub-menu can have another submenu, etc.
I was is something similar like facebook comment and reply model.
First I have model of menu like:
public int MenuId { get; set; }
public string Name { get; set; }
public string Controller { get; set; }
public string Action { get; set; }
public int Order { get; set; }
public string Icon { get; set; }
public bool IsAdmin { get; set; }
Sub-menu:
public int SubMenuId { get; set; }
public int MenuId { get; set; } // Menu Fk
public string Name { get; set; }
public string Controller { get; set; }
public string Action { get; set; }
public int Order { get; set; }
public string Icon { get; set; }
public bool IsAdmin { get; set; }
It's my logic correctly?, someone implement something similar? What I need to do into controller to make it works?, if someone have an example I really apreciated it. Thanks in Advance