ViewState does not work
I have created an ascx control in which I try to place a simple object into viewstate for use on postback's for this my control. When I place an object into viewstate, it exists a few lines later when I update it. However on postbacks, the viewstate is always empty on my button click event handler. I read in another post that I needed to enable viewstate in my master page. When I placed 'this.Page.EnableViewState = true;' in my Masterpage OnInit event, i receievd a new error stating that my simple object needed to have the [Serializable] attribute. I added the attribute, but the view state is still empty on postback.
What else should I try to resolve this.
Hi John Hunter,
Thank you for using our services.
Can you please show us the full code you are using the OnInit event? This should not require serializable attribute. We have logged this issue for fixing (#66613) and will soon provide an option to set this from page properties in settings.
Kind regards,
Radoslav Georgiev
the Telerik team