public ActionResult Index(HtmlPage model)
        {
            if (ModelState.IsValid)
            {
               // db.Entry(model).State = EntityState.Modified;

                model.Pages = db.SavePage(model);
            }

            return View(model);
        }
Example #2
0
        public IEnumerable<SelectListItem> SavePage(HtmlPage model)
        {
            _db = new GeckoModel();
            using (_db)
            {

                var page =  _db.HtmlPages.First(p => p.HtmlPageName == model.HtmlPageName);
                page.HtmlPageContent = model.HtmlPageContent;

                _db.SaveChanges();

                return GetPagesForDropDown();

            }
        }