Q:

How do I count checked checkboxes across all pages of a gridview using jquery?

I want to instantly update a status line indicating the number of checked checkboxes across all pages of an asp.net gridview.  Right now I am only ably to count the number of checkboxes that are checked on the current gridview page.
Here is my code:
$(document).ready(initAll);

function initAll(){
   countChecked();
    $(".activeBoxes").click(countChecked);
}

function countChecked() {

      var n = $(".activeBoxes input:checked").length;
      $("#checkboxStatus").text(n + (n == 1 ? " vehicle is" : " vehicles are") + " selected on this page.  ");
      if( n == 0){
           $(".activateButton").hide();
           $("#checkboxStatus").hide();

      }else{
        $("#checkboxStatus").show();
        $(".activateButton").show();
      }

}

A:

Keep a hidden text field on your page and everytime you check a box, call a javascript method that will write the 'id' of the checkbox to the hidden field. Each time you postback your page, serialise the hidden field's value to the session in your desired objects structure (be it objects, hash table, array etc). 
Upon rendering the page, each checkbox can check the session object structure (that you have created before) and determine if the state of the checkbox was last checked or not.
You could use JQuery to loop through all checkboxes on the page and increment a counter if the checkbox is checked.

