@{Html.RenderAction("TopMenuToLoad", "TopMenu");}
@model IEnumerable<OrderProcessing.Database.Menu> <table> @foreach (var item in Model) { <tr> <td> Html.ActionLink(item.MenuName, item.ControllerPath) </td> </tr> } </table>
namespace OrderProcessing.Controllers { public class TopMenuController : Controller { // // GET: /Menu/ [ChildActionOnly] public ActionResult TopMenuToLoad() { MVCLearningDBEntities Entities = new MVCLearningDBEntities(); var Menus = Entities.Menus.Where(x => x.IsActive == true).ToList(); return View(Menus); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)