public ActionResult Edit(Quiz quiz) { if (ModelState.IsValid) { db.Entry(quiz).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } PopulateStateDropdownList(quiz.StateID); return(View(quiz)); }
public ActionResult Edit( [Bind(Exclude = "Date")] Exercise exercise) { if (ModelState.IsValid) { db.Entry(exercise).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } PopulateCategoryDropdownList(exercise.CategoryID); return(View(exercise)); }