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(); }
partial void DeleteUser(User instance);
partial void UpdateUser(User instance);
partial void InsertUser(User instance);