UserControls, Properties and the ViewState

  • Thread starter Thread starter trullock
  • Start date Start date
T

trullock

Hi,

To make my usercontrol remember the values i set in its public
properties across postbacks, do i need to explicity write code in the
getters and setters to enter the data into the viewstate?

I'm hoping there's some decoration (or something else) i can apply to
the properties to make their values be persisted automatically?

Thanks for any advice

Andrew
 
Hi,

To make my usercontrol remember the values i set in its public
properties across postbacks, do i need to explicity write code in the
getters and setters to enter the data into the viewstate?

Yes. Or, use something other than viewstae (e.g. put your public properties
into a class and store an instance of the class in the session).
I'm hoping there's some decoration (or something else) i can apply to
the properties to make their values be persisted automatically?

Not to my knowledge.
 
Yes. Or, use something other than viewstae (e.g. put your public properties
into a class and store an instance of the class in the session).


Not to my knowledge.

Thanks for the info

Andrew
 
Back
Top