i will getting the problem when add to checked item another list box
this is add but it add repeat checked item
and this check box inside datalist
and the code write on check box OnCheckedChanged events.
i want checked item add into listbox my code is:
protected void OnCheckedChanged(object sender, EventArgs e)
{
foreach (DataListItem item in divProducts.Items)
{
Label lbl_pro_nm = (Label)item.FindControl("lbl_pro_nm");
CheckBox chkbox = (CheckBox)item.FindControl("chkbox");
if (chkbox.Checked)
{
ListBox1.Items.Add(lbl_pro_nm.Text);
}
else
{
ListBox1.Items.Remove(lbl_pro_nm.Text);
}
}
}


Midhun TpRank #388 · 6.5K reputationPosted Jul 27, 2016, 9:26 PM EDT
Devendra KumarRank #3,132 · 457 reputationPosted Jul 27, 2016, 9:49 PM EDT
hi ,Midhun Tpthanks for your suggestion try it.