Custom Controls, Public properties and the Viewstate

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

trullock

Hi,

I've written a custom control which needs to have several public
properties.

Do i have to write a viewstate getter and setter for every property,
or is there some decoration (or other method) i can apply to make
their values be persisted across postbacks?

Thanks

Andrew
 
you need to write a getter/setter for each property. most controls public
properties are just viewstate getter/setters. you can use the
LoadControlState and SaveControlState methods to get/set one serializable
object instead.

-- bruce (sqlwork.com)
 
Back
Top