I am creating controls on some input XML. The controls are then added to the different PlaceHolder Control which is places in a table. Here is the code for reference
private void RenderFactorControls(string xml)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
foreach (XmlNode xmlNode in xmlDoc.DocumentElement.ChildNodes)
{
CheckBox factorCheckBox = new CheckBox();
factorCheckBox.ID = "chkBox"+xmlNode.Attributes["id"].Value;
factorCheckBox.Text = xmlNode.Attributes["id"].Value;
this.pholderControls1.Controls.Add(factorCheckBox);
this.pholderControls2.Controls.Add(factorCheckBox);
this.pholderControls3.Controls.Add(factorCheckBox);
this.pholderControls4.Controls.Add(factorCheckBox);
this.pholderControls5.Controls.Add(factorCheckBox);
}
}
Only the last place holder shows the controls.