public ActionResult Login(LoginViewModel loginModel) { if (loginModel.Username == "*****@*****.**" && loginModel.Password == "admin") { loginModel.Username = "******"; CurrentFPApplicationContext.LoggedInUser = new LoggedInUser() { UserId = loginModel.UserId, Password = loginModel.Password, Username = loginModel.Username, IPAddress = System.Web.HttpContext.Current.Request.UserHostAddress, }; if (HttpContext.Request.QueryString["returnUrl"] != null) { string returnUrl = HttpContext.Request.QueryString["returnUrl"].ToString(); if (!string.IsNullOrWhiteSpace(returnUrl)) { return Redirect(returnUrl); } } return RedirectToAction("Index", "Home"); } return View(loginModel); }
public ActionResult Login() { loginModel = new LoginViewModel(); return View(loginModel); }