Guest User

Untitled

a guest
Jul 17th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // GET: Login
  2. public ActionResult Login()
  3. {
  4. return View();
  5. }
  6. [HttpPost]
  7. public ActionResult Login(string username, string password)
  8. {
  9. bool isAuthenticated = PCSSession.Current.AuthenticateUser(username, password);
  10.  
  11. if(isAuthenticated)
  12. {
  13.  
  14. return RedirectToAction("Landing","Start");
  15. }
  16. else
  17. {
  18. return RedirectToAction("Login", "Login");
  19. }
  20.  
  21. }
  22.  
  23. <script>
  24.  
  25.  
  26. $("#btnLogin").click(function () {
  27. $.post("/Login/Login",
  28. {
  29. username: $('#Username').val(),
  30. password: $('#Password').val(),
  31. },
  32. function (data) {
  33. if (data == "True") {
  34.  
  35. } else {
  36.  
  37. }
  38. });
  39. });
Add Comment
Please, Sign In to add comment