say we have simple asp.net repeater, in a row we have one checkbox, one label (database-id of the record) and not visible (used for postback) and one text (in a tabelcell)
now i want to make it like in windows, if you click on the text, the checkbox should be selected or deselected.
has somebody a link or solution for this, maybe already with jQuery?
Edit: as i said, it is a asp.repeater. and the table is for layout, so using the checkbox.text property is not designable (e.g. line wrap) the ids of the checkbox and text are dynamically added/changed on rendering of the repeater. therefore the label solution does also not really work.
assume that you wont’t need jQuery and the table-construct
this renders basically the solution provided by Ricardo Vega whatever you get in the property text of the checkbox is clickable, and checks/unchecks the checkbox … therefor you should use <%# Eval(‘…’) %> you can skin (via css) the margin of the label
Edit:
After thinking about this once again, there is another solution:
Notes: You can use the Text-attribute of the asp:Label-Element either!