ViewState does not work

Posted by Community Admin on 03-Aug-2018 22:06

ViewState does not work

All Replies

Posted by Community Admin on 01-Dec-2010 00:00
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.
Posted by Community Admin on 02-Dec-2010 00:00
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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
This thread is closed