how to determine checkboxlist is checked/selected -
<p>when i execute the code i get 4 checkboxs and i checked/selected all 4 checkbox and when i try to debug the code, it does count that i have 4 checkbox but all 4 checkbox is selected=false.</p>

<p>what i am missing in code?</p>

<pre><code>&lt;asp:checkboxlist id="chk" runat="server" ondatabinding="chk_DataBinding"
   ondatabound="chk_DataBound"&gt;
&lt;/asp:checkboxlist&gt;

List&lt;String&gt; roles = new List&lt;string&gt;();

 for (int i = 0; i &lt; chk.Items.Count; i++)
 {
     if (chk.Items[i].Selected)
    {
        roles.Add(chk.Items[i].Value);
    }
 }
</code></pre>
