SHARE
TWEET

Untitled

Ortund Sep 16th, 2014 188 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top