title: Determining number of selected check boxes in view
body: <p>I have a .NET MVC application with a view that generates HTML containing multiple tables (this varies according to the user's input selections from the previous view).  Each table can have a varying number of check boxes (controlled by the user's selections from the previous view) that the user can use to makes selections that will be sent to a final report.  The check boxes are being written to the .aspx file via HTML helpers generated in a 'for' loop:  </p>
  
  <pre><code>    &lt;%: Html.CheckBox("optionSelect" + checkCounter)%&gt;
  </code></pre>
  
  <p>checkCounter has been added so that each check box has a different name that follows an ascending numerical pattern.  The numbering does not get reset if the next check box is part of a new table (i.e., the 3 check boxes in the first table are "optionSelect1" through "optionSelect3", the 3 check boxes in the second table are "optionSelect4" through "optionSelect6").  </p>
  
  <p>What would be a good way to determine which check boxes in this view have been selected so that that information may be used by the controller class upon submission of the user's selections?  At the very least, is there a way to tell the controller class the total number of check boxes that have been generated for the view?  I'm new to the .NET MVC framework, so if others can point out other options I have missed, I would appreciate it.  </p>