Nested Usercontrols and ViewState

Posted by Bob Smith on Stack Overflow See other posts from Stack Overflow or by Bob Smith
Published on 2009-02-06T16:11:22Z Indexed on 2010/03/31 19:03 UTC
Read the original article Hit count: 267

Filed under:

I have a UserControlParent that dynamically loads UserControlChild.

In the UserControlChild, I store a value using the ViewState object by doing a

ViewState["count"] = myCount;

On Postbacks, the ViewState returns a null. Is this because the UserControlChild is being loaded dynamically? If it helps, the UserControlParent is loaded dynamically in the ASPX page as well.

© Stack Overflow or respective owner

Related posts about ASP.NET