コード例 #1
0
        public ActionResult Login(LoginModel model, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                //WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe))
                string success = App_Code.CustomSecurityProvider.Login(model.UserName, model.Password, model.RememberMe);

                if (success == "ok")
                    return RedirectToLocal(returnUrl);
                else
                    ModelState.AddModelError("", success);
            }

            return View("Login", model);
        }
コード例 #2
0
 public ActionResult Login(string returnUrl)
 {
     var model = new LoginModel();
     ViewBag.ReturnUrl = returnUrl;
     return View(model);
 }