Advertisement
Guest User

Untitled

a guest
May 5th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <div class="nav pull-right checkbox navbar-btn">
  2. @Html.CheckBox("ShowInactive", false) Show Inactive
  3. </div>
  4.  
  5. <script type="text/javascript">
  6. $(document).ready(function () {
  7. $("#ShowInactive").prop("checked", @HttpContext.Current.Application["ShowInactive"]);
  8. $("#ShowInactive").click(function () {
  9. if (this.checked) {
  10. @HttpContext.Current.Application["ShowInactive"] = true;
  11. }
  12. else
  13. {
  14. @HttpContext.Current.Application["ShowInactive"] = false;
  15. }
  16. //This is to make the grid reload after the checkbox is changed.
  17. location.reload();
  18. });
  19. });
  20. </script>
  21.  
  22. public static class GlobalVariables
  23. {
  24. public static bool ShowInactive
  25. {
  26. get { return (bool)HttpContext.Current.Application["ShowInactive"]; }
  27. set { HttpContext.Current.Application["ShowInactive"] = value; }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement