Exemplo n.º 1
0
        public ActionResult Login(string returnUrl)
        {
            if (returnUrl == "/")
                return Redirect("/login");

            var vd = new LoginModel();
            return View(vd);
        }
Exemplo n.º 2
0
        public ActionResult Login(string user, string pass, string url)
        {
            var vd = new LoginModel();
            if (Current.Security.ValidateUser(user, pass))
            {
                FormsAuthentication.SetAuthCookie(user, true);
                return Redirect(url.HasValue() ? url : "/");
            }
            vd.ErrorMessage = "Login failed";

            return View("~/Views/Login/Login.cshtml", vd);
        }