Advertisement
Guest User

Untitled

a guest
Aug 14th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement