Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. $dialog.dialog("option", "buttons", {
  2. "Save": function () {
  3. var dlg = $(this);
  4. $.ajax({
  5. url: $url,
  6. type: 'POST',
  7. data: $("#" + formName).serialize(),
  8. success: function (response, textStatus, xhr) {
  9. $(target).html(response);
  10. dlg.dialog('close');
  11. dlg.empty();
  12. }
  13. },
  14. error: function (xhr, status, error) {
  15. ....
  16. }
  17. });
  18. },
  19. "Cancel": function () {
  20. $(this).dialog("close");
  21. $(this).empty();
  22. }
  23.  
  24. });
  25.  
  26. @using (Html.BeginForm("Edit", "Patient", null, FormMethod.Post, new { id = "form", enctype = "multipart/form-data" }))
  27.  
  28. $dialog.dialog("option", "buttons", {
  29. "Save": function () {
  30. var dlg = $(this);
  31. var formData = new FormData($("#" + formName)[0]);
  32. $.ajax({
  33. url: $url,
  34. type: 'POST',
  35. data: formData,
  36. processData: false,
  37. contentType: false,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement