I have a field from the db called sections and I have the following checkbox control on the markup.
<asp:CheckBox runat="server" ID="sections" />
<label for="sections">Section values</label>
Then on codebehind, I use this code to render checkbox control with value property and actual value of Sections displayed just the way I want it.
Me.sections.InputAttributes.Add("Value", "Miracle Alley")
My issues now are 2 fold:
1, what is the best way to add CheckAll/UncheckAll feature to the markup so users can check a checkbox or checkboxes to display a value or values associated with checked box(es)?
2, We would like to declare a variable and assign the value of checked box to this variable.
For instance, if sections is checked then
var sectionsList = sections values.
Is this possible?
If not, any alternative solutions?
Thanks a lot in advance.
Try the following:
1) please note that you should have 2 elements with IDs of
#checkAlland#unCheckAlland load jQuery library 🙂2)