-1

Hay Can some one do me favour:'(
I need complete code for Check/Uncheck all items in checkboxlist using asp.net in serverside.
I kept one checkboxlist and bound data source to it in runtime and using two linkbutton to check or uncheck items in checkboxlist.i need to reterive data from selected checkboxlist.
i want this in server side code not by javascript.
I tried this code in linkbutton click event but no hope.

foreach(ListItem item in checkboxlist1.Items)
{
item.selected=true;
}

but no hope:icon_cry: pls some one help me......

Edited by __avd: code tags

4
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by shibbard
0

Code looks ok, is the checkboxlist inside another control - i.e. a gridview or detailsview or something?

0

Are you sure that u r not doing any other mistake & you have data there in Checkbox list..? As your code is correct & it should work.I tried it in my application & it is working fine.Try to debug & put the breakpoints on Linkbutton's Click event, see what's the problem.

Hay Can some one do me favour:'(
I need complete code for Check/Uncheck all items in checkboxlist using asp.net in serverside.
I kept one checkboxlist and bound data source to it in runtime and using two linkbutton to check or uncheck items in checkboxlist.i need to reterive data from selected checkboxlist.
i want this in server side code not by javascript.
I tried this code in linkbutton click event but no hope.
foreach(ListItem item in checkboxlist1.Items)
{
item.selected=true;
}
but no hope:icon_cry: pls some one help me......

0

i think the code should work.are you binding data to checkbox again after that foreach statement anywhere...?

0

I tried no use. Pls some one post me the coding.... I kept the checkboxlist inside a panel. And tried to check all items in runtime server side coding through linkbutton... But its not working

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.