Guest User

Untitled

a guest
Jan 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public HttpResponseMessage<lightUserInfo> Post(LogOnModel model)
  2. {
  3. if (ModelState.IsValid)
  4. {
  5. if (Membership.ValidateUser(model.UserName, model.Password))
  6. {
  7. MembershipUser user = Membership.GetUser(model.UserName);
  8. var userinfo = new lightUserInfo(user);
  9. return new HttpResponseMessage<lightUserInfo>(userinfo);
  10. }
  11. }
  12. }
  13.  
  14. $.ajax
  15. url: Meshable.rooturl + "/api/authentication"
  16. data: JSON.stringify authenticationDetails
  17. dataType: "json"
  18. type: "POST"
  19. contentType: 'application/json; charset=utf-8'
  20. error: (e) ->
  21. success: (data) ->
  22. #data comes in as empty {}
  23.  
  24. using System.Runtime.Serialization;
  25.  
  26. [DataContract]
  27. public class UserInfo
  28. {
  29. [DataMember]
  30. public string mystr {get; set;}
  31.  
  32. }
Add Comment
Please, Sign In to add comment