public ActionResult LogIn(string userName, string passWord) { //call repo method to get account absed on username AppUserRepo repo = new AppUserRepo(); var user = repo.GetUser(userName); if (user == null) { ViewBag.Error = "No account with that username"; return(View()); } if (user.passWord != passWord) { ViewBag.Error = "Incorrect password"; return(View()); } // pass accounts user ID to details view return(RedirectToAction("Details", new { userID = user.userID })); }