Guest User

Untitled

a guest
Aug 25th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. <HttpPost()>
  2. Function WFUserEdited(ByVal userdetails As userdetails) As ActionResult
  3. Return View()
  4. End Function
  5.  
  6. Public Class userdetails
  7. Public Property Username As String
  8. Public Property Password As String
  9. Public Property Fullname As String
  10. Public Property Location As String
  11. Public Property Appcode As String
  12. Public Property Userlevel As String
  13. End Class
  14.  
  15. $("#btnSubmit").click(function () {
  16. var q = validate();
  17. if (q = true) {
  18. var userdetails = {};
  19. userdetails.UserName = $('#txtusername').val().toString();
  20. userdetails.Password = $('#txtPassword').val().toString();
  21. userdetails.Fullname = $('#txtfullName').val().toString();
  22. userdetails.Location = $('#txt_location').val().toString();
  23. userdetails.Appcode = $("#drp_appcode").chosen().val().toString();
  24. userdetails.Userlevel = $("#drp_userlevel").chosen().val().toString();
  25. userdetails = JSON.stringify(userdetails);
  26. var url = '@Url.Action("WFUserEdited", "WFUser")';
  27.  
  28. $.ajax({
  29. url: url,
  30. type: 'POST',
  31. traditional: false,
  32. contentType: "application/json; charset=utf-8",
  33. dataType: 'json',
  34. data: { "userdetails": userdetails },
  35. success: function (data) {
  36. },
  37. error: function (data) {
  38. }
  39. });
  40. }
  41. });
  42. });
  43.  
  44. Protected Overrides Function BeginExecuteCore(callback As AsyncCallback, state As Object) As IAsyncResult
  45. Try
  46. ViewBag.UserImage = "http://_layouts/15/CaptarisWFTasksWebPart/EmployeeImages/sree.jpg"
  47.  
  48. Catch generatedExceptionName As Exception
  49. Return MyBase.BeginExecuteCore(callback, state)
  50. End Try
  51. Return MyBase.BeginExecuteCore(callback, state)
  52. End Function
Add Comment
Please, Sign In to add comment