public ActionResult Crear(FormCollection collection) { if (ModelState.IsValid) { var model = new Producto(); TryUpdateModel(model, new string[] { "Nombre", "Descripcion", "ImagePath", "Visible", "Precio" }, collection.ToValueProvider()); repository.AddProducto(model); return(RedirectToAction("Index")); } else { // Error ModelState.AddModelError("", "Error goes here"); } return(View()); }