Advertisement
Guest User

Untitled

a guest
Jun 6th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. $.ajax({
  2. type: "GET",
  3. url: "Home/LogIn",
  4. data: { userName: username, password: password },
  5. dataType: 'json',
  6. succes: function (data) {
  7. alert(data.d + ' Succes')
  8. },
  9. failure: function (data) {
  10. alert(data.d + ' failure');
  11. }
  12. });
  13.  
  14. public string LogIn(string userName, string password)
  15. {
  16. LogInController loginController = (LogInController)Session["LogInController"];
  17.  
  18. User tempuser = loginController.CheckLogin(password, userName);
  19.  
  20. if (tempuser != null)
  21. {
  22. massdrop = new MassdropShop(tempuser);
  23. Session["LoggedInName"] = tempuser.Name;
  24. Session["massdrop"] = massdrop;
  25. return "1";
  26. }
  27. else
  28. return "0";
  29. }
  30.  
  31. succes: function (data) {
  32. alert(data.d + ' Succes')
  33. },
  34.  
  35. success: function (data) {
  36. alert(data.d + ' Succes')
  37. },
  38.  
  39. data:{ userName: username, password: password },
  40.  
  41. change
  42. data:JSON.stringify{ userName: username, password: password },
  43. success: function (data) {
  44.  
  45.  
  46. alert(JSON.stringify(data.d));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement