failed to get repeater checkboxlist text
<p>i am trying to get all the check value from user,but i failed to do so</p>

<p>refer the the //problem below, while checkboxlist item is selected, it should return to me what user has selected, but it cant detect what user has checked</p>

<p><strong>bind repeater item</strong></p>

<pre><code>if (Session["test"] != null)
{
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
    SqlCommand cmdLoadQuestion = new SqlCommand("getTestQuestion",conn);
    conn.Open();
    cmdLoadQuestion.Parameters.Add("@subject",SqlDbType.VarChar).Value=Session["test"].ToString();
    cmdLoadQuestion.CommandType = CommandType.StoredProcedure;

    SqlDataReader dtrLoadQuestion;
    dtrLoadQuestion = cmdLoadQuestion.ExecuteReader();
    Repeater1.DataSource = dtrLoadQuestion;
    Repeater1.DataBind();

    dtrLoadQuestion.Close();
    conn.Close();
}
else
{
    Response.Redirect("~/HomePage.aspx");
}

//check answer from db
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
conn.Open();
foreach (RepeaterItem items in Repeater1.Items)
{
    SqlCommand cmdCheckAnswer = new SqlCommand("Select Answer From ExerciseTable where Question='" + ((Label)items.FindControl("Label3")).Text + "'", conn);
    SqlDataReader dtrCheckAnswer;
    dtrCheckAnswer = cmdCheckAnswer.ExecuteReader();
    if (dtrCheckAnswer.Read())
    {
        CheckBoxList chkList = (CheckBoxList)items.FindControl("chkOption");

        foreach (ListItem a in chkList.Items)
        {    
        //Problem
        if (a.Selected == true)
            {
                marks.InnerHtml += dtrCheckAnswer["Answer"].ToString() + " user Answer:" + a.Text + "&lt;br/&gt;";
            }
            else
            {
                marks.InnerHtml += "u check nth at all";
            }
        }         
    }
    else
    {
        marks.InnerHtml = "error";
    }
    dtrCheckAnswer.Close();
}
conn.Close();
//end check answer
</code></pre>
