let's say I have a custom User Web Control with a title property.
The title is set with a Title attribute in my control's tag.
Why should I store it in the ViewState? it make the ViewState big (slower
GET/POST) and it's set in the page anyway.
I don't understand, could anyone enlighten me ?In some operations it helps to make sure that the values stay the same, or
to keep the values in a form that a user may go back to after filling out. I
tend to use it more when creating wizard-like pages, where I step through a
series of panels. Instead of trying to save the results of each panel I can
instead save the information into the viewstate and perform my actions on it
all at once. The ViewState is also a neat place to store variables that you
may need such as a counter for the numbre of times someone has performed a
task (such as getting an incorrect password in a login form so that the form
can shut them down or warn them against trying to guess someone's password).
Like all things, it has it's purposes but most of the time you don't
necessarily need it turned on for everything.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"Lloyd Dupont" <ld@.NewsAccount.galador.net> wrote in message
news:eV13jJhnEHA.4004@.TK2MSFTNGP10.phx.gbl...
> let's say I have a custom User Web Control with a title property.
> The title is set with a Title attribute in my control's tag.
> Why should I store it in the ViewState? it make the ViewState big (slower
> GET/POST) and it's set in the page anyway.
> I don't understand, could anyone enlighten me ?
>
You store it in the view state because the title is going to be a static pie
ce of information
The view state is a cache on the web page of information that you intend to
be static for a period
thanks all for your answers
"Mark Fitzpatrick" <markfitz@.fitzme.com> wrote in message
news:OBMpyahnEHA.4068@.tk2msftngp13.phx.gbl...
> In some operations it helps to make sure that the values stay the same, or
> to keep the values in a form that a user may go back to after filling out.
> I tend to use it more when creating wizard-like pages, where I step
> through a series of panels. Instead of trying to save the results of each
> panel I can instead save the information into the viewstate and perform my
> actions on it all at once. The ViewState is also a neat place to store
> variables that you may need such as a counter for the numbre of times
> someone has performed a task (such as getting an incorrect password in a
> login form so that the form can shut them down or warn them against trying
> to guess someone's password). Like all things, it has it's purposes but
> most of the time you don't necessarily need it turned on for everything.
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
> "Lloyd Dupont" <ld@.NewsAccount.galador.net> wrote in message
> news:eV13jJhnEHA.4004@.TK2MSFTNGP10.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment