示例#1
0
 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");
     }
 }
示例#2
0
        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);
            }
        }
示例#3
0
 public static void SetSeoContent(this Controller controller, SiteViewModel model)
 {
     controller.ViewBag.Title = model.Title;
     controller.ViewBag.SeoDescription = model.SeoDescription;
     controller.ViewBag.SeoKeywords = model.SeoKeywords;
 }