checking & unchecking a HTML checkbox inside repeater based on database value
Posted
by subash
on Stack Overflow
See other posts from Stack Overflow
or by subash
Published on 2010-06-11T10:50:07Z
Indexed on
2010/06/11
10:52 UTC
Read the original article
Hit count: 204
i have a repeater control with item templates having check boxes,and i need the check boxes inside the repeatercontrol to be checked based on the database value of a column field "enabled" of bool type of either true or false.
the code is as below what modification should i make to check and uncheck the check box?
<asp:Repeater ID="rptrDashboardIssue" runat="server">
<ItemTemplate>
<%issueEnum += 1;%>
<div style="margin-left: -20px; position: absolute;" id="divModificationCaseflow">
<input type="checkbox" name="chkModificationCaseflow" id="chkModificationCaseflowIssue<%=issueEnum%>" checked="<%# DataBinder.Eval(Container.DataItem, "enabled")%>" />
</div>
</ItemTemplate>
</asp:Repeater>
© Stack Overflow or respective owner