How can I re-instantiate dynamic ASP.NET user controls without using a database?

I’m currently working with a part of my application that uses Dynamic Web User Controls and I’m having a bit of trouble figuring out the best way to re-instantiate the controls on postback by using ViewState or some other method that doesn’t require me to query a database on each postback.

Persistent dynamic control in ASP.Net

<asp:Button onclick="Some_event" Text="Add TextBox" ID="id1" runat="server" /> //once clicked: <asp:TextBox ID="txt1" ……></asp:TextBox> //when clicked again: <asp:TextBox ID="txt1" ……></asp:TextBox> <asp:TextBox ID="txt2" ……></asp:TextBox> //and so on… Is there a way to create dynamic controls which will persist even after the postback? In other words, when the user clicks on the button, a new textbox will be generated … Read more