简体   繁体   中英

Counting the number of checked items inside of a Repeater ASP .NET

my javascript/ jquery is rusty. How would i go about getting the count of checked items inside of a repeater from ASP .NET web forms, if it helps i can slap a div around it. Could someone show me some example code please? Thank you

Asp repeater :

<asp:Repeater ID="YourRepeaterID" runat="server" >
</asp:Repeater>

Count check box inside a repeater:

 var count = 0;
 count = $('#' + '<%= YourRepeaterID.ClientID %>').find('input:checked').length;

Note : your jquery code must be inside document.ready and don't forget to include jquery library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM