i have a checkboxlist control
<asp:CheckBoxList ID="chkselectedItems" Font-Size="12px" runat="server">
</asp:CheckBoxList>
and i created listitems on it dynamically.If i checked more than one item from the checkbox list, How i get the selected item count using asp.net
thanks
ASP.NET CheckBoxList is a web control that can be used to collate the items that can be checked, thus giving the user the ability to select multiple items simultaneously. This list of items in the CheckBoxList can be dynamically generated using the Data Binding functions.
Use this single line of code:
int selectedCount = chkselectedItems.Items.Cast<ListItem>().Count(li => li.Selected);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With