Hi Avinash,
I think Cells[0] contains your checkbox and Cells[1] contains your EmpID
The below code will solve your problem.
protected void btn_3id_Click(object sender, EventArgs e)
{
ArrayList str = new ArrayList();
foreach (GridViewRow rows in GridView1.Rows)
{
CheckBox chk = (CheckBox)GridView1.Rows[rows.RowIndex].FindControl("CheckBox1");
if (chk.Checked)
{
str.Add(GridView1.Rows[rows.RowIndex].Cells[1].Text.ToString());
}
}
Session["card_id"] = str;
Response.Redirect("ID.aspx");
}
Please let me know if you still facing any issues.
Regards,
Manoj