public ActionResult Create(Product product, HttpPostedFileBase ProductImage1, HttpPostedFileBase ProductImage2, HttpPostedFileBase ProductImage3) { if (ModelState.IsValid) { string filename = Path.GetFileName(ProductImage1.FileName); string path = Path.Combine(Server.MapPath("~/Photos/"), filename); ProductImage1.SaveAs(path); product.ProductImage1 = "~/Photos/" + filename; string filename2 = Path.GetFileName(ProductImage2.FileName); string path2 = Path.Combine(Server.MapPath("~/Photos/"), filename2); ProductImage2.SaveAs(path2); product.ProductImage2 = "~/Photos/" + filename2; string filename3 = Path.GetFileName(ProductImage3.FileName); string path3 = Path.Combine(Server.MapPath("~/Photos/"), filename3); ProductImage3.SaveAs(path3); product.ProductImage3 = "~/Photos/" + filename3; Handler.AddProduct(product); return(RedirectToAction("Index", "Product")); } ViewBag.CategoryId = new SelectList(Context.Categories, "Id", "Name", product.CategoryId); ViewBag.SubCategoryId = new SelectList(Context.SubCategories, "Id", "Name", product.SubCategoryId); return(View(product)); }