multiple value insertion in a single cell os grid view using checkbox
hello,
checkboxes are in gridview.
when we select more than 1 checkbox, then their respective value move to another page's grid view.
following is the code for whcih i've to insert more than 1 value in a single cell of grid view.
each value is seperated with ","
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox chkbx = (CheckBox)row.FindControl("CheckBox1");
string Id = null;
string hname = row.Cells[1].Text.ToString();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
if (chkbx.Checked)
{
Id = Id + row.Cells[0].Text.ToString() + ",";
Response.Redirect("HotelMaster.aspx?m1=" + Id + "&m2=" + hname);
}
}
}
what is wrong with this code..?
what will be the right code.
please help me to solve this problem..
thank you