SHARE
TWEET

Untitled

a guest Aug 14th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. services.AddAntiforgery(o => o.HeaderName = "XSRF-TOKEN");
  2. services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
  3. services.AddSession();
  4. services.AddMemoryCache();
  5.      
  6. <script type="text/javascript">
  7.     $(function updateRow () {
  8.         $.get('/FinalApprovalLetter/').done(function () {
  9.  
  10.                 $('#success').append([message returned from JsonResult OnGet]);
  11.             });
  12.         });
  13.     });
  14. </script>
  15.      
  16. <input type="button" class="d-print-none" value="Set Final Date For Course (today)" onclick="updateRow" />
  17.    <br />
  18.     <label id="success" />
  19.      
  20. public JsonResult OnGet()
  21. {
  22.   //DO database row update, insert today's date in FinalApprovalDate field
  23.   //DETERMINE AND RETURN SUCCESS/FAILURE (records affected)
  24.   //I HAVE CODE TO DO THIS AND IT WILL WORK
  25.  
  26.     return new JsonResult("[success/failure message");
  27. }
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
 
Top