what is,& what is not saved in viewstate automatically?

  • Thread starter Thread starter xamman
  • Start date Start date
X

xamman

hi there,
from what i understand not all objects & variables are saved in the
viewstate, even though all objects & vars are lost after the page
response is sent to the client browser.

is there any rule to determine what is automatically kept by .NET in
the viewstate (i.e. only objects inheriting from a specific class or
control?) between postbacks

thanks,
x
 
xamman said:
hi there,
from what i understand not all objects & variables are saved in the
viewstate, even though all objects & vars are lost after the page
response is sent to the client browser.

is there any rule to determine what is automatically kept by .NET in
the viewstate (i.e. only objects inheriting from a specific class or
control?) between postbacks

thanks,
x

Nothing is saved in the viewstate automatically. Everything in the
viewstate is put there by the controls themselves.

A TextBox control, for example, will put the original value of the Text
property in the viewstate, so that it can compare that to the new value
that comes in the postback.
 
Back
Top