Advertisement
Ortund

Untitled

Sep 16th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.06 KB | None | 0 0
  1. <div id="modalBackground"></div>
  2. <div id="modalDialog">
  3.     <p id="modalTitle"></p>
  4.  
  5.     <div id="modalMessage"></div>
  6.     <div id="modalDetail"></div>
  7.     <div id="modalControls">
  8.         <a id="lnkMoreDetail">More Detail</a><button id="btnOK">Okay</button>
  9.     </div>
  10. </div>
  11.  
  12.     <script>
  13.         $("#btnSubmit").on("click", function () {
  14.             var $form = $("form#frmCreateUser");
  15.             $form.submit();
  16.         });
  17.  
  18.         $("form#frmCreateUser").submit(function () {
  19.             $.post($(this).attr("action"), $(this).serialize(), function (data) {
  20.                 if (!data.IsOK) {
  21.                     $("#modalTitle").html(data.Title);
  22.                     $("#modalMessage").html(data.Message);
  23.                     $("#modalDetail").html(data.Error);
  24.                     $("#modalBackground").Show();
  25.                     $("#modalDialog").Show();
  26.                     }
  27.                 else
  28.                 {
  29.                     window.location.href = '@Url.Content("~/Users")';
  30.                 }
  31.             });
  32.         });
  33.     </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement