protected void btnbook_Click(object sender, EventArgs e) { int id = 0; foreach (GridViewRow gvrow in gvcar.Rows) { if (((CheckBox)gvrow.FindControl("chkSelect")).Checked == true) { var dataKey = gvcar.DataKeys[gvrow.RowIndex]; if (dataKey != null) Response.Write((string) ("ID:"+dataKey.Value+"Name of Car"+gvrow.Cells[1].Text)); } else { MessageBox.Show("Please select a car"); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)