I want to ask about Dynamic Database Driven Menu Loading in ASP.Net
MVC3 razor .
This is my
1.View Code
2.Model for Menu
3.Model For
Put below div in _Shared.cshtml
Make new _MenuLayout.cshtml
view for dynamic generated menu
In your controller , write code to get Data from database table e.g. MenuTable and prepare list and assign values like below
ViewBag.Menu = list;
and in your _MenuLayout.cshtml
partial view place below code,
@{ var menusList = ViewBag.Menu as IEnumerable; }
@if (menusList != null)
{
}