Loop through GridView Rows. Try this:
protected void btn_3id_Click(object sender, EventArgs e)
{
string str = "";
string srr = "";
foreach (GridViewRow row in GridView1.Rows)
{
if (((CheckBox)row.FindControl("CheckBox1")).Checked)
{
if (str == "")
{
str = row.Cells[0].Text.ToString();
}
else
{
srr = str + "," + row.Cells[0].Text.ToString();
}
}
Session["Card_id"] = str;
Response.Redirect("ID.aspx");
}
}
--Amit