I am trying to loop through all the checkboxes and get their Value and if they are checked or not and save the checked/unchecked into database based on the Value which is going to contains the ID of the record. I am trying to do this through asp.net any suggestions?
Here is the code:
<Columns>
<asp:TemplateField HeaderText="Application" ItemStyle-Width="25%">
<ItemTemplate>
<%#Eval("App")%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Edit" ItemStyle-Width="25%">
<ItemTemplate>
<input name="chkEdit" runat="server" value='<%# Eval("AppID") %>' class="checkbox" type="checkbox" checked='<%# Eval("Edit") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete" ItemStyle-Width="25%">
<ItemTemplate>
<input name="chkDelete" runat="server" value='<%# Eval("AppID") %>' class="checkbox" type="checkbox" checked='<%# Eval("Delete") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="View" ItemStyle-Width="25%">
<ItemTemplate>
<input name="chkView" runat="server" value='<%# Eval("AppID") %>' class="checkbox" type="checkbox" checked='<%# Eval("View") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
1 Answer