You have to add things in the right order. Keep in mind, the viewstate is
only loaded at certain times so you may not have access to the items because
the viewstate hasn't been re-created. Another thing to keep in mind is
you'll need to re-create the controls to ensure that the viewstate has an
object to load into.
There are some custom controls out there that can help you though. One of
them is a dynamic placeholder that stores child control viewstates
automatically.
http://www.denisbauer.com/ASPNETCont...aceholder.aspx I
haven't used it in a long time, but it was very useful for one project I
did.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Phuff" <pc*****@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
Okay, I know that the page load is the best place to do this, but I
have to add my controls inside a button click. Anyway, I tried using a
placeholder and that was no go. Why will asp not keep the dynamically
added controls in the viewstate?!?!? It is so very frustrating. Leave
up to M$ to be counter-intuitive.