J
Jon
Hi!
I'm creating a custom Server Control which implements the method in the
subject line (Protected override void CreateChildControls)
In here I have the following code:
LBL myLbl = new LBL();
myLbl.ID = "MyLbl";
myLbl.Text = objCustomFieldUtil.GetName("custom");
this.Controls.Add(new LiteralControl("<td class=\"regLabelCell\">"));
this.Controls.Add(myLbl);
this.Controls.Add(new LiteralControl("</td>"));
Now what I'd like to do is add the child controls dynamically by looping
through a Data Table:
for(int i = 0; i < objDT.Rows.Count; i++)
{
//Implement Adding Controls here
}
The problem arises that I need to declare my label or textbox before I can
added it. Anyone know a way around this?
Thank you.
I'm creating a custom Server Control which implements the method in the
subject line (Protected override void CreateChildControls)
In here I have the following code:
LBL myLbl = new LBL();
myLbl.ID = "MyLbl";
myLbl.Text = objCustomFieldUtil.GetName("custom");
this.Controls.Add(new LiteralControl("<td class=\"regLabelCell\">"));
this.Controls.Add(myLbl);
this.Controls.Add(new LiteralControl("</td>"));
Now what I'd like to do is add the child controls dynamically by looping
through a Data Table:
for(int i = 0; i < objDT.Rows.Count; i++)
{
//Implement Adding Controls here
}
The problem arises that I need to declare my label or textbox before I can
added it. Anyone know a way around this?
Thank you.