
How to get checkbox data after form submit using c#


Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
KalaiPosted Feb 24, 2014, 8:16 AM
protected void btnProcess_Click(object sender, EventArgs e)
{
StringBuilder sbCheck_val = new StringBuilder();
foreach (GridViewRow row in grid.Rows)
{
CheckBox chk = (CheckBox)row.FindControl("chk");
if (chk.Checked)
{
Label lblId = (Label)row.FindControl("lblId");
sbCheck_val.Append(lblId.Text + ",");
}
}
lblmsg.Text = "Selected Roll Numbers are : " + sbCheck_val.ToString().TrimEnd(',');
}
Lakshmanan Sethu SankaranarayanPosted Feb 24, 2014, 8:13 AM
Shweta LodhaPosted Feb 24, 2014, 7:14 AM