Hi there,
Is this related to the book Beginning ASP.NET 3.5? If not, you may be better off posting this in one of the general ASP.NET forums as more people are able to join the discussion.
Anyway, yes you can dynamically create controls. For example, try this:
1. Add a PlaceHolder control to a new page
2. Add this to the code behind:
TextBox myBox = new TextBox();
myBox.ID = "SomeID";
PlaceHolder1.Controls.Add(myBox);
Remember, you'll need to recreate the whole control hierarchy every time the page loads (that is, initial loads and postbacks). So, instead of pesisting it, you'll need to recreate it. Also be aware of submitted state. You typically need to create controls in an early event like PreInit.
For more info:
http://www.google.com/search?hl=nl&q...le+zoeken&meta=
Another way is to create User Controls on the fly the first time the page is requested, then save them to disk as .ascx files and reuse them on subsequent requests.
Cheers,
Imar