Exemplo n.º 1
0
 public RedirectToRouteResult CheckLogin(string username, string password)
 {
     ViewBag.Title = "Login to website";
     if (ac.CheckLoginAccount(username, password))
     {
         FormsAuthentication.SetAuthCookie(username, false);
         Session["creator"] = username;
         return(RedirectToAction("Home", "Home"));
     }
     else
     {
         TempData["error"] = "Username or password was wrong!  ";
         //return RedirectToAction("Index", "Login");
         return(RedirectToAction("Index", "Login"));
     }
 }