Reputation: 140
I have a grid view with number of pages.using check box i like to get value of selected check boxes. i have no idea to get value from selected check boxes in different pages.Please give me your suggestion and coding for this.
Upvotes: 0
Views: 9307
Reputation: 63
Use this one
protected void btnClick_Click(object sender, EventArgs e)
{
StringBuilder sbQuery = new StringBuilder();
bool flag = false;
foreach (GridViewRow row in gridview1.Rows)
{
if (((CheckBox)row.FindControl("chk")).Checked)
{
flag = true;
//------
}
}
}
Upvotes: 1
Reputation: 13801
As you have illustarted in question i am assuming that you want checkboxes values so i have one linke which i providing you this will help you to understand how would you achieve and also i am recommanding you to use javascript
Get the value of checked checkbox?
this is javascript i have other links of gridview also
http://forums.asp.net/t/1125079.aspx
How to get checkbox value from gridview when checkbox OnCheckedChanged
regards...:)
Upvotes: 1