i have this code where on the click of a button i want to get the Empid of all those checkboxes that are checked in each row. but the string variable str is always empty and doesnt take any value.why is this so? kindly help\[code\] protected void btn_3id_Click(object sender, EventArgs e) { string str = ""; string srr = ""; for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox chk = (CheckBox)GridView1.Rows.FindControl("CheckBox1"); if (chk.Checked) { if (str == "") { str = GridView1.Rows.Cells[0].Text.ToString(); } else { srr = str + "," + GridView1.Rows.Cells[1].Text.ToString(); } } } Session["card_id"] = str; Response.Redirect("ID.aspx"); }}\[/code\]