I have a main category and main category has its subcategory list in database. So its a relational database. For better understanding .edmx map picture is attached. Now my goal
1.Change @Html.Partial("_GuestNav") to @{Html.RenderAction("_GuestNav", "YourControlerName");}
2.Add @Model TypeofYourViewModel on top of your partial view.
3.Change the looping as follows:
@foreach (var item in Model)
{
-
@item.MainCatName
}
Note: Change TypeofYourViewModel to whatever ViewModel you are passing into the partial view