public ActionResult Create(Product collection) { if (ModelState.IsValid) { // do stuff like add to the database, etc. return RedirectToAction("Index"); } else { return View(); } }
public ActionResult Create(Product collection) { try { // TODO: Add insert logic here return RedirectToAction("Index"); } catch { return View(); } }