Object reference not set to an instance of an object for repeater
<p>Basically I wish to get my dynamic <code>CheckboxList.SelectedItem.Text</code> but I failed to do so. When I checked one of the items in CheckboxList, it can't detect that I am checked the item.</p>

<p><strong>my checkboxlist item</strong></p>

<p>A</p>

<p>B</p>

<p>C</p>

<p>D</p>

<p><strong>output(after checked A)</strong></p>

<p>You check nothing</p>

<p>You check nothing</p>

<p>You check nothing</p>

<p>You check nothing</p>

<p><strong>expected output(after checked A)</strong></p>

<p>A</p>

<p><strong>my page.aspx</strong></p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    //load question for test

    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");
    }
}



CheckBoxList chk = ((CheckBoxList)Repeater1.Items[0].FindControl("chkOption"));
foreach (ListItem li in chk.Items)
{
    if (li.Selected)
    {
        Response.Write(li.Text);
    }
    else
    {
        Response.Write("You Check Nothing");
    }
}
</code></pre>
