Exemplo n.º 1
0
 public ActionResult login_error(LoginModel lm)
 {
     return View();
 }
Exemplo n.º 2
0
        public ActionResult Login(LoginModel model)
        {
            if (ModelState.IsValid)
            {
                if (Membership.ValidateUser(model.UserName, model.Password))
                {
                    FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
                    membership_check mc = new membership_check();
                    mc.change_status(model.UserName);
                    Thread.Sleep(500);
                    return RedirectToAction("Index", "myprofile");
                }
                else
                {
                    ModelState.AddModelError("", "The user name or password provided is incorrect.");
                }
            }

            // If we got this far, something failed, redisplay form
            return RedirectToAction("login_error", model);
        }