F
Fresh Air Rider
I am having trouble getting checkboxes to work within Repeaters and
DataGrids
I have tried to access the value of each checkbox within a repeater
which has been ticked as follows :-
string sValues ="values";
foreach (RepeaterItem ri in rptrPublications.Items){
CheckBox cbx = (CheckBox)ri.FindControl("cbxPub");
if(cbx.Checked){
sValues = sValues + cbx.Checked.ToString();
}
}
Response.Write(sValues);
For some reason, it doesn't recognise the cbx.Checked statement, but
if I remove this line, it happily writes out the values of each
checkbox.
I am also having getting a checkbox's OnCheckedChanged event to fire
when it's within either s Repeater or a DataGrid
Could anyone please put forward some suggestions ?
Thanks
DataGrids
I have tried to access the value of each checkbox within a repeater
which has been ticked as follows :-
string sValues ="values";
foreach (RepeaterItem ri in rptrPublications.Items){
CheckBox cbx = (CheckBox)ri.FindControl("cbxPub");
if(cbx.Checked){
sValues = sValues + cbx.Checked.ToString();
}
}
Response.Write(sValues);
For some reason, it doesn't recognise the cbx.Checked statement, but
if I remove this line, it happily writes out the values of each
checkbox.
I am also having getting a checkbox's OnCheckedChanged event to fire
when it's within either s Repeater or a DataGrid
Could anyone please put forward some suggestions ?
Thanks