I have a Repeater
control which contains a CheckBox
and a lable control in each row. When a CheckBox
is selected. I want to retrieve the text of the Label
for the corresponding CheckBox
. How to get it?
Add the following to the CheckBox.Checked
event handler:
CheckBox checkBox = (CheckBox) sender;
Label label = (Label) checkBox.Parent.FindControl("LabelName");
String labelText = label.Text;