ok, i have this:
<div class="radio-toolbar">
<input type="checkbox" id="check1" name="checks" value="1">
<label for="check1">1</label>
<input type="checkbox" id="check2" name="checks" value="2">
<label for="check2">2</label>
<input type="checkbox" id="check3" name="checks" value="3">
<label for="check3">3</label>
</div>
and i'm looking for a way to set the "onclick" attribute of those labels with ASP.NET VB Codebehind, making the labels looks like:
<div class="radio-toolbar">
<input type="checkbox" id="check1" name="checks" value="1">
<label for="check1" onclick="some javascript">1</label>
<input type="checkbox" id="check2" name="checks" value="2">
<label for="check2" onclick="some javascript">2</label>
<input type="checkbox" id="check3" name="checks" value="3">
<label for="check3" onclick="some javascript">3</label>
</div>
so, is that possible?
Use a
asp:Label
.Then in your code behind:
Edit: You could simply use
asp:CheckBox
and use itsText
Property. Clicking the text would then fire the onclick event of yourCheckBox
.