public ActionResult Login(LoginViewModel loginViewModel) { if (ModelState.IsValid) { if (loginViewModel.UserName == "jason" && loginViewModel.Password == "123123") { Session["login"] = "******"; return Redirect(loginViewModel.ReturnUrl); } } return RedirectToAction("Index", "OnePageCheckout"); }
public ActionResult Login() { LoginViewModel viewModel = new LoginViewModel(); return View("Login", viewModel); }
public ActionResult Login(LoginViewModel loginViewModel) { if (ModelState.IsValid) { if (loginViewModel.UserName == "jason" && loginViewModel.Password == "123123") { Session["login"] = "******"; return RedirectToAction("Index"); } else { ModelState.AddModelError("UserName", "username or password is wrong."); } } var resultModel = GetCheckoutModel(); return View("OnePageCheckout", "DefaultLayout", resultModel); //return RedirectToAction("Index"); }