예제 #1
0
 public ActionResult Login(LogOnModel model)
 {
     if (ModelState.IsValid)
     {
         if (auth.CheckUser(model.UserName, model.Password) != null)
         {
             FormsAuthentication.SetAuthCookie(model.UserName, true);
             return(RedirectToAction("Index", "Races"));
         }
         else
         {
             ModelState.AddModelError("", "The username or password is incorrect, please try again");
         }
     }
     return(View(model));
 }