My custom server control generates a table, containing custom cells containing textboxes that have been populated
with data from the database.
All the textboxes are editable, and there is a Button control that causes a postback.
By default, if I click this button, obviously any changes I made to the textboxes will be overwritten as the first thing the control does is get the data from the dataset and populate the textboxes. So I save the values in viewstate myself by creating a viewstate property. (I just write this code once as I have a nested custom control for each table cell.)
Unfortunately, the values don't seem to be saving to viewstate, as when the controls try to load viewstate, it is empty.
What am I doing wrong? Is this a problem with using custom server controls? Is it because it is regenerating the cells each time and treating them as brand new?