how to get selected items count in asp:checkboxlist

前端 未结 4 1549
离开以前
离开以前 2021-02-15 18:01

i have a checkboxlist control

 
 

4条回答
  •  余生分开走
    2021-02-15 18:09

    Use this single line of code:

    int selectedCount = chkselectedItems.Items.Cast().Count(li => li.Selected);
    

提交回复
热议问题