public ActionResult AddNewProduct(Product p) { if (SessionCheck.checkSession(Session["name"] as string)) { HttpPostedFileBase file = Request.Files[0] as HttpPostedFileBase; dep.AddnewProduct(p, file); return(RedirectToAction("AddNewProduct")); } else { return(Redirect("Home/index")); } }