public ActionResult Create(Product product, HttpPostedFileBase File) { if (ModelState.IsValid) { RepositoryProduct.StoreProduct(product, File); TempData["Message"] = string.Format("Creado {0} correctamente", product.Name); return(RedirectToAction("Index")); } ViewBag.Message = string.Format("Error al crear {0}, debe colocar correctamente los datos", product.Name); ViewBag.CategoryID = ctx.Categories.ToList(); return(View(product)); }