> I am stuck on how to make a screen whose fields are created at runtime so it
> can 'morf'' to meet the needs of the current situation.
[quoted text clipped - 19 lines]
> able to read and write information to the server controls. But I am unable
> to reference the newly created server controls.
Actually, it is not a big problem to create a cell and a control in
it.
Instead of PlaceHolders, try following
// create first row
HtmlTableRow r1 = new HtmlTableRow();
HtmlTableCell c1 = new HtmlTableCell();
r1.Cells.Add(c1);
// create second row
HtmlTableRow r2 = new HtmlTableRow();
HtmlTableCell c2 = new HtmlTableCell();
r2.Cells.Add(c2);
Table1.Rows.Add(r1);
Table1.Rows.Add(r2);
// then you can add a control, e.g.
TextBox txt = new TextBox();
txt.ID = "mytext";
r1.Cells[1].Controls.Add(txt);
xzzy - 24 Jun 2007 15:34 GMT
the problem is: after the viewer adds/changes information in the textbox,
how to reference the information in the textbox
>> I am stuck on how to make a screen whose fields are created at runtime so
>> it
[quoted text clipped - 46 lines]
> txt.ID = "mytext";
> r1.Cells[1].Controls.Add(txt);
Alexey Smirnov - 24 Jun 2007 20:01 GMT
> the problem is: after the viewer adds/changes information in the textbox,
> how to reference the information in the textbox
you would need an EventHandler
HOW TO: Dynamically Create Controls in ASP.NET by Using Visual C# .NET
http://support.microsoft.com/kb/317794