public ActionResult ForgetPass(LoginModel m) { LoginDal logindal = new LoginDal(); if (!logindal.EmailExist(m.Email)) { ViewBag.femail = "Email Id not Registered"; return(View()); } Passenger p = new Passenger(); p.Email = m.Email; p.Pwd = m.Pwd; logindal.ChangePassword(p); ViewBag.msg = "Password Changed Successfully!!"; return(View()); }