title: In Code behind, get all checked values of dynamically created CheckBoxList
body: <p>In ASP.NET Web Forms, how would I get all checked items of a CheckBoxList that was programmatically created.  Assume that I only know the ID of the CheckBoxList.</p>
  
  <p>My guess is something like:</p>
  
  <pre><code>var checklist = Find.Control(id);
  foreach (ListItem item in checklist)
  {
      if (item.Checked)
      {
          ..Do something
      }
  }
  </code></pre>
  
  <p>But that doesn't seem to grab the CheckBoxList correctly.</p>
  
  <p>Edit: I posted the way I solved it below.</p>