public ActionResult Edit([Bind(Include = "CategoryID,Category")] CategoryList categoryList) { if (ModelState.IsValid) { db.Entry(categoryList).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(categoryList)); }
public ActionResult Edit([Bind(Include = "TopicID,Topic1,Tags,CategoryID,UserId,TimeStamp,TopicURL,Search")] Topic topic) { if (ModelState.IsValid) { db.Entry(topic).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryID = new SelectList(db.CategoryLists, "CategoryID", "Category", topic.CategoryID); return(View(topic)); }