I would like to set the value of my label (or div) as an element and not text.
Example, this code creates a list of checkboxes as followed in this post How to use Checkbox inside Select Option :
<asp:Label runat="server" id="checkboxesList">
<label for="one">
<input type="checkbox" id="one" />First checkbox</label>
<label for="two">
<input type="checkbox" id="two" />Second checkbox</label>
<label for="three">
<input type="checkbox" id="three" />Third checkbox</label>
</asp:Label>
I need to create my List in CodeBehind and not directly in ASPX I tried :
checkboxesList.Text = "<label for=\"one\"> < input type = \"checkbox\" id = \"one\" /> First checkbox </ label > <label for= \"two\" > < input type = \"checkbox\" id = \"two\" /> Second checkbox </ label >";
Doing so it only prints as a string and do not create the differents labels. How to implement it from the code behind having just :
<asp:Label runat="server" id="checkboxesList">
</asp:Label>