Re: IStateManager in a class object
- From: "Brad" <lane@xxxxxxxxxxxxxxxx>
- Date: Thu, 29 Sep 2005 10:38:46 -0700
Thanks for the reply....but you lost me there. If I'm using this in a page
I understand about overriding the pages LoadViewState, SaveViewState...and
calling the helper class LoadViewState, etc... The paradox I'm lost on is
how the instance of the helper is saved and reinstantiated such that the
value in it's statebag persist. The page needs to instantiate the helper
somewhere. And if the helper has a constructor which instantiates the
statebag, the statebag (and thus the viewstate) is going to be empty.
"Brock Allen" <ballen@xxxxxxxxxxxxxxxxx> wrote in message
news:b8743b1131b5c8c7933231a98e4c@xxxxxxxxxxxxxxxxxxxxxxx
This approach is typically done when a control (or the page) needs to use
a helper object to track the viewstate. So the usage model is for the
control
to instantiate an instance of the helper object and then override all of
the IStateManager APIs and call into the helper object for each one (so
override
LoadViewState and the call into the helper's LoadViewState, etc...). This
is how the helper object gets 'hooked into' the page model. I hope that just
made sense :)
-Brock
DevelopMentor
http://staff.develop.com/ballen
> I am creating a class (not a control) which implements IStateManager.
> I've created the class and all of the implementations (LoadView,
> SaveViewState, etc...). My Question is: How do I instantiate this
> class in a page and then re-instantiate it on post back such that I
> don't lose it's viewstate? If the page always uses x = new myclass to
> instantiate, the myclass constructor is always going to reinitialize
> its statebag.
>
.
- Follow-Ups:
- Re: IStateManager in a class object
- From: Brock Allen
- Re: IStateManager in a class object
- References:
- Re: IStateManager in a class object
- From: Brock Allen
- Re: IStateManager in a class object
- Prev by Date: Problems setting a cookie that already exists
- Next by Date: Re: How to share VB code across multiple pages?
- Previous by thread: Re: IStateManager in a class object
- Next by thread: Re: IStateManager in a class object
- Index(es):
Relevant Pages
|
Loading