public ActionResult MyProfile(tbllogin user, HttpPostedFileBase file) { string Image = string.Empty; userServices _ser = new userServices(); if (file != null) { string path = Path.Combine(Server.MapPath("~/assets/images/users"), file.FileName); file.SaveAs(path); Image = "/assets/images/users/" + file.FileName; user.Image = Image; Session["image"] = Image; } var msg = _ser.UpdateProfile(user, Image); user = _ser.GetLoginUser(user.UserId); ViewData["msg"] = msg; return(View(user)); }