dharmendr:
<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id">
<ItemTemplate>
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<div class="form-check form-check-inline" id="projectchk">
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="CategoryID" runat="server" Text='<%# Eval("ProjectNo") %>' class="form-check-input" />
</ItemTemplate>
<FooterTemplate>
</div>
</FooterTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:FormView>
$(function () {
$("[id*=btnAgregar]").click(function () {
var checked_checkboxes = $("[id*=projectchk] input:checked");
var message = "";
checked_checkboxes.each(function () {
var text = $(this).closest("td").find("label").html();
message += "Text: " + text;
message += "\n";
});
alert(message);
return false;
});
});
Rendered:
<table cellspacing="0" border="0" id="ctl00_cphGlobalContent_FormView1" style="border-collapse:collapse;">
<tbody>
<tr>
<td colspan="2">
<div class="form-check form-check-inline" id="projectchk">
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl01_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl01$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl01_CategoryID">170449</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl02_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl02$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl02_CategoryID">170450</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl03_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl03$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl03_CategoryID">170451</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl04_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl04$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl04_CategoryID">170452</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl05_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl05$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl05_CategoryID">170453</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl06_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl06$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl06_CategoryID">170454</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl07_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl07$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl07_CategoryID">170455</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl08_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl08$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl08_CategoryID">170456</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl09_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl09$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl09_CategoryID">170457</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl10_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl10$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl10_CategoryID">170458</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl11_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl11$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl11_CategoryID">170459</label></span>
<span class="form-check-input"><input id="ctl00_cphGlobalContent_FormView1_Repeater1_ctl12_CategoryID" type="checkbox" name="ctl00$cphGlobalContent$FormView1$Repeater1$ctl12$CategoryID"><label for="ctl00_cphGlobalContent_FormView1_Repeater1_ctl12_CategoryID">170460</label></span>
</div>
</td>
</tr>
</tbody>
</table>