UserControls, Properties and the ViewState

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
 
S

Scott Roberts

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.
 
T

trullock

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top