[HttpPost]
public ActionResult Register(Employee employee, HttpPostedFileBase file)
{
string path = Path.Combine(Server.MapPath("~/Images"), Path.GetFileName(file.FileName));
file.SaveAs(path);
Employee _emplyee = new Employee();
_emplyee.Name = employee.Name;
_emplyee.Username = employee.Username;
_emplyee.EmailId = "~/Images/" + file.FileName;
_emplyee.Password = employee.Password;
_emplyee.Gender = "Male";
_emplyee.FkCityId = employee.FkCityId;
_emplyee.FkCountryId = employee.FkCountryId;
_emplyee.FkStateId = employee.FkStateId;
TestEntities db = new TestEntities();
db.Employees.Add(_emplyee);
db.SaveChanges();
return RedirectToAction("Register", "Home");
}
also set