public ActionResult Create(Product collection)
        {
            if (ModelState.IsValid) {

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

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }