public ActionResult Create(Content model) { if (ModelState.IsValid) { var data = new ContentData(); var id = data.InsertContent(model); if (id > 0) { return(RedirectToAction("Index", "Content")); } else { ModelState.AddModelError("", "Cannot add content"); } } SetviewBag(); return(View()); }