Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. [HttpPost]
  2. public ActionResult Login(LoginViewModel login)
  3. {
  4. if (!ModelState.IsValid)
  5. {
  6. ViewBag.Error = "Form is not valid; please review and try again.";
  7. return View("Login");
  8. }
  9.  
  10. if (login.Username == "bpradmin" && login.Password == "admin123")
  11. FormsAuthentication.RedirectFromLoginPage(login.Username, true);
  12.  
  13. ViewBag.Error = "Credentials invalid. Please try again.";
  14. return View("Login");
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement