ASP.NET dynamically created controls and Postback

For anyone else trying to do something like this: don’t. Instead, think of the flow of information and understand that there is a better way to do it. The input control(s) do not need to be dynamically created. They can be static, and upon filling out and submitting on one, that information has to go somewhere (database, cache, session, for example). Once its there, on postback, loop through all items in your storage of choice and create a display for them.

That is what I’ve done and it has made life a lot easier. Hope it helps someone.

Leave a Comment