Confirm.cshtml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @*
  2. For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
  3. *@
  4. @using LiveInfo.Models;
  5. @model PartialViewModel;
  6. <link rel="stylesheet" type="text/css" href="~/css/css/model.css">
  7. <script>
  8. $('#myContent').modal('hide');
  9. </script>
  10. <div class="modal-content">
  11. <div class="modal-header">
  12. <h4 class="modal-title" id="modalLabelService">Response</h4>
  13. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  14. <span aria-hidden="true">×</span>
  15. </button>
  16. </div>
  17. <div class="modal-body">
  18. <div>
  19. <h3>
  20. @Model.message
  21. </h3>
  22. </div>
  23. </div>
  24. <div class="modal-footer">
  25. <button id="closeBtn" type="button" class="btn grey btn-outline-secondary" data-dismiss="modal">Close</button>
  26. <button type="button" id="btnAgree" class="btn btn-outline-primary">Agree</button>
  27. </div>
  28. </div>
  29. <script>
  30. $("#btnAgree").on("click", function () {
  31. console.log("agree");
  32. $.ajax({
  33. type: "POST",
  34. url: "@Model.url",
  35. headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
  36. data: {
  37. "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
  38. "id": "@Model.id",
  39. "tableType": "@Model.tableType",
  40. },
  41. success: function (data) {
  42. $.ajax({
  43. type: "POST",
  44. url: "/Partial/Response",
  45. data: {
  46. "message": data.message
  47. },
  48. success: function (data) {
  49. $('#informModel').html(data);
  50. $('#myInform').modal({ "backdrop": "static", keyboard: true });
  51. $('#myInform').modal('show');
  52. },
  53. failure: function (data) {
  54. alert(data);
  55. },
  56. error: function (data) {
  57. alert(data);
  58. }
  59. });
  60. },
  61. failure: function (data) {
  62. alert(data);
  63. },
  64. error: function (data) {
  65. alert(data);
  66. }
  67. });
  68. })
  69. </script>