Reputation: 3927
I have a user control, with viewstate enabled. i am using it on a page with viewstate disabled.How can I access viewsate info?
Upvotes: 0
Views: 263
Reputation:
As I know the ViewState property is a protected member of the Control class so it not accessible from other objects. If you just write "ViewState" in a Page declaration, it is actually the member of that Page object which in your case is disabled.
However you should be able to reach your user control's ViewState within your User Control.
See this explanation: http://msdn.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic5
But anyway, this doesn't look like a good way of storing state information on a web page.
Upvotes: 1