Use the following code to edit the student Image.
First save the image from the FileUpload in Edit Action method and assigned saved path to the Image property.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit([Bind(Include = "ID,Name,Dob,EmailID,Password,PhoneNO,Image,CityId,ZipCode,Address,Gender")] Student student, HttpPostedFileBase image)
{
if (ModelState.IsValid)
{
string hashedPassword = BCrypt.Net.BCrypt.HashPassword(student.Password);
student.Password = hashedPassword;
var fileName = Path.GetFileName(image.FileName);
image.SaveAs(Path.Combine(Server.MapPath("~/S_Images/" + image.FileName)));
student.Image = fileName;
db.Entry(student).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}
ViewBag.CountryId = new SelectList(db.Countries, "ID", "CountryName", student.City.State.CountryID);
ViewBag.StateId = new SelectList(db.Cities, "ID", "StateName", student.City.StateId);
ViewBag.CityId = new SelectList(db.Cities, "ID", "CityName", student.CityId);
return View(student);
}