Template checkbox checked property is getting false in Gridview for delete operation
<p>I have used template CheckBox in gridview for multiple rows deletion, when I select multiple rows by selecting the CheckBox and perform the delete operation it seems to be selected CheckBox is not returning true on the code below.</p>

<p>protected void Button6_Click(object sender, EventArgs e)
        {</p>

<pre><code>        foreach (GridViewRow row in GridView1.Rows)
        {
            LinkButton ch = new LinkButton();
            ch = (LinkButton)row.FindControl("l1");
            id = Convert.ToInt16(ch.CommandArgument);
            CheckBox chs = new CheckBox();
            chs = ((CheckBox)row.FindControl("c1"));

            if (chs.Checked == true)
            {
                DeleteSelected(id);
            }
        }
    }

private void DeleteSelected(short id)
{
    var ch = from a in empd.Employees where (a.ID == id) select a;
    empd.Employees.DeleteAllOnSubmit(ch);
    empd.SubmitChanges();
    display_emp();
}
</code></pre>

<p>Could someone please assist me why <code>CheckBox</code> is not returning true value in calling function.</p>

<p>Well now I have fixed the connection everything, please just refresh the database.Please get the web application in the below link.</p>

<p><a href="http://www.ziddu.com/download/20716096/WebApplication.zip.html" rel="nofollow">http://www.ziddu.com/download/20716096/WebApplication.zip.html</a>
Please help me on why selected checkbox are not returning true in the code.</p>
