예제 #1
0
        public ActionResult Login(User user, string returnUrl)
        {
            if (ModelState.IsValid)
                if (!Membership.ValidateUser(user.UserName, user.Password))
                {
                    ModelState.AddModelError("", "User/Pass is invalid.");
                    TempData["message"] = "Invalid login!";
                }

            if (ModelState.IsValid)
            {
                // grant cookie and redirect to home
                FormsAuthentication.SetAuthCookie(user.UserName, false);
                return Redirect(returnUrl ?? Url.Action("Index", "Home"));
            }
            else // validation error, so redisplay the same view
                return View();
        }
예제 #2
0
 partial void DeleteUser(User instance);
예제 #3
0
 partial void UpdateUser(User instance);
예제 #4
0
 partial void InsertUser(User instance);