public ActionResult Index(LoginIndexModel model) { UserInfo user = this.IUserInfoDataProvider.FindUserInfoByUserNameAndPassword(model.UserName, model.Password); if (user != null) { FormsAuthentication.SetAuthCookie(user.ID.ToString(), true); return RedirectToAction("Index", "Home", null); } else { model.IsFail = true; return View(model); } }
// GET: Login public ActionResult Index() { LoginIndexModel model = new LoginIndexModel(); return View(model); }