Yet one more reason why I avoid ViewState whenever possible and rarely (if 
ever) seek it out for more uses.

If you need the value of a dynamic control, I suggest pulling it from the 
Request.Form collection.  If it's more than that, stick it in cache.  One of 
EasyListBox's first features was the ability to maintain state without 
Viewstate... 

 From: "Zed Burton" [EMAIL PROTECTED]

There is one way around this ugly mess here
http://aspnet.4guysfromrolla.com/articles/092904-1.aspx

Basically you must create the controlin Page_Init to make sure 
viewstate save picks it up. and then create again OnInit and remove 
oin Page_load if not needed. Sounds like a dog chasing his tail.

Thanks

--- In [email protected], "Peter Brunone" 
wrote:
> 
> That's because any dynamic controls are not added to Viewstate.
> 
> You can try manually adding them to the Page.Viewstate
> collection, but then of course you'll have to manually pull them out 
on
> postback and put them in the page again (at least as I understand 
it).
> 
> -----Original Message-----
> From: [email protected] On Behalf Of Zed Burton
> 
> I create a control dynamically in the code behind, but when it posts 
> back, its not in viewstate, what gives?

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

Yahoo! Groups Links







[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to