title: How to get checkboxlist selected property as true
body: <p>I  my aspx page i am taking a checkboxlist control and populating data from database. But when i used to select the item and debug my code always selected property  used to come as false.How to solve this.<BR><BR> My code is</p>
  
  <pre><code> &lt;asp:CheckBoxList ID="chkProduct" Width="200px" Height="90px" runat="server"    
   RepeatDirection="Vertical" style="overflow-y: scroll;
                              overflow-x: scroll;"&gt;
                         &lt;/asp:CheckBoxList&gt;
  </code></pre>
  
  <p><BR>
            Code Behind</p>
  
  <pre><code> for (int j = 0; j &lt; chkProduct.Items.Count; j++)
      {
          //CheckBoxList chkProduct;
          foreach (ListItem list in chkProduct.Items)
          {
              if (list.Selected )
              {
                  enquiryProducts = new Services.EnquiryProduct();
                  enquiryProducts.IsDelete = false;
                  enquiryProducts.ProductID = Convert.ToInt32(chkProduct.Items[j].Value);
                  enquiryProductList.Add(enquiryProducts);
              }
          }
      }
  </code></pre>