title: How to add only checked checkboxes added in array list?
body: <p>I want to insert checkbox text only if they are checked. How to do that?</p>
  <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      TextBox1.Text = Request.QueryString(&quot;txt&quot;)
      Dim splitted As String() = TextBox1.Text.Split(&quot;,&quot;)
      For Each id As String In splitted
          Dim ctrl As Control = Page.FindControl(&quot;checkbox&quot; &amp; id)
  
          If Not ctrl Is Nothing Then
              Dim chkbox As CheckBox = DirectCast(ctrl, CheckBox)
              chkbox.Enabled = False
              Dim arrList As New ArrayList()
              'populate the list with some temp values
              arrList.Add(CheckBox1.Text)
              arrList.Add(CheckBox2.Text)
  
              'databind the list to our repeater
              Repeater1.DataSource = arrList
              Repeater1.DataBind()
          End If
      Next
  End Sub
  </code></pre>
  <p>This code will add all checkboxes whether it is checked or not !</p>
  <p>Can any body do that... so that only checked checkboxes would be added in array list</p>