If a control such as checkboxlist is created dynamically.
like this
CheckBoxList CbxList = new CheckBoxList();
CbxList.ID = "Cbx";
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
CbxList.Items.Add(new ListItem(ds.Tables[0].Rows[i]["Name"]
.ToString(), ds.Tables[0].Rows[i]["ID"].ToString()));
}
ph.Controls.Add(CbxList);
If on the selectedIndexChange event of the created checkboxlist(cbx) if i am updating an ajax update panel how should i specify the ControlID Attribute. I did try Cbx in my case but it says no controls and off course that control is not created yet. So how to handle this issue
The only thing that I can think of needing a control ID is the triggers collection; if that is the case, why not put the checkboxlist within the updatepanel, and use an updatemode=”always” on the panel itself?