For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > March 2004 > Dynamic Controls and ViewState









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Dynamic Controls and ViewState
Josh Cossiboon

2004-03-28, 10:32 pm

Anybody ever dynamically add controls to an aspx page, save it to the
StateBag and load the dynamically created objects from the statebag on
postback?

I dynamically create and add controls to a placeholder, add it to the
ViewState. On postback, I'm trying to set the placeholder from viewstate
back to the original placeholder.

'... created and added all controls to placeholder
viewstate.add("vsSurveyLayout",plcSurveyLayout)

'on post back....
plcSurveyLayout = ctype(viewstate.item("vsSurveyLayout"),PlaceHolder)

I get a weird serialization error when I try to add the control to the
viewstate.
Any ideas?

Josh


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com