public ActionResult ShowFilter() { using (var context = new ModelContainer()) { SiteViewModel model = new SiteViewModel(context, null, null); ViewBag.Categories = model.Categories; ViewBag.Elements = model.Elements; return PartialView("_SearchCriteriaSelector"); } }
public ActionResult Index(string id) { using (var context = new ModelContainer()) { SiteViewModel model = new SiteViewModel(context, id, id); this.SetSeoContent(model); ViewBag.MainMenu = model.MainMenu; ViewBag.isHomePage = model.IsHomePage; ViewBag.Categories = model.Categories; ViewBag.Elements = model.Elements; return View(model); } }
public static void SetSeoContent(this Controller controller, SiteViewModel model) { controller.ViewBag.Title = model.Title; controller.ViewBag.SeoDescription = model.SeoDescription; controller.ViewBag.SeoKeywords = model.SeoKeywords; }