title: Checkbox Checked Event for multiple dynamic Checkboxes
body: <p>I have an aspx page where I dynamically create checkboxes and add them to a panel from data in a SQL database. I need to have only one checkbox checked at a time. I have tried and googled just about everything but I cannot get the right answer. How would I go about getting that done. </p>
  
  <p>My code for creating the checkboxes</p>
  
  <pre><code>public void CreateTimeSelection()
          {
              DataSet times = GetTimes();
              int i = 0;
              foreach (DataTable table in times.Tables)
              {
                  foreach (DataRow row in table.Rows)
                  {
                      CheckBox chkTime = new CheckBox();
                      i += 1;
                      chkTime.ID = row["Time"].ToString();
                      chkTime.AutoPostBack = true;
                      chkTime.Text = row["Time"].ToString(); 
                      chkTime.CheckedChanged += new EventHandler(this.CheckChanged_click);
                      pnlTimeSlots.Controls.Add(chkTime);
                      pnlTimeSlots.Controls.Add(new LiteralControl("&lt;br /&gt;"));
                  }
              }
          }
  </code></pre>
  
  <p>Code for Checkbox event handlers</p>
  
  <pre><code>protected void CheckChanged_click(object sender, EventArgs e)
          {
              CheckBox chkSelect = (CheckBox)sender;
              if (chkSelect.Checked == true)
              {
                  //set other checkboxes to false
              }                
          }
  </code></pre>