I have a repeater, in each ItemTemplate of the repeater is an asp:checkbox with an OnCheckedChanged event handler set. The checkboxes have the AutoPostBack property set to t
You have to define eventhandler for checklist out of repeater item command, then inside the repeater item command, go through checklist items and get checked items.
In the .aspx page you can use Ajax and updatepanel to fire eventhandler, but keep in mind you have to define scriptmanage outside of repeater.
// checklisk checkedchange eventhandler
protected void chkLinked_CheckedChanged(Object sender, EventArgs args)
{
}
and item repeater command item: // iterate checklist items and detect checked
protected void Repeater1_ItemCommand(object sender, RepeaterCommandEventArgs e)
{
CheckBoxList cbl = (CheckBoxList)e.Item.FindControl("CheckBoxList1");
cbl.SelectedIndexChanged += new EventHandler(chkLinked_CheckedChanged);
string name = "";
for (int i = 0; i < cbl.Items.Count; i++)
{
if (cbl.Items[i].Selected)
{
name += cbl.Items[i].Text.Split(',')[0] + ",";
}
}
}