Ghosted pages (unCustomized): the Pages that stored on File System like
The default home page
Site Definition pages.
Unghosted pages (Customized) : the pages that stored in SharePoint Content Database
SitePages like [Add/display/edit].
Custom Master Pages.
Note : All the Unghosted sites are based on Ghosted Site Definition.
Turns out that web application has a setting that can be controlled through Powershell
$web = Get-SPWebApplication "http://mywebapp..." $web.FormDigestSettings.TimeOut
This is by default 30 minutes and SharePoint Viewstate cache is cleared after FormDigestSettings.TimeOut +1 (i.e. 31 minutes)
$web.FormDigestSettings.TimeOut = New-TimeSpan -Hours 1 -...
I ended up doing this:
I added a hidden asp textbox, which the value does persist between postbacks, and when the hour dropdown changes i put the selected value into the textbox.
Then on page load of the panel I check if the value in the textbox is different than that in the hour dropdown and if it is I set the selected value in the dropdown to be what is in ...
I think you answered your own question in your comment:
So I better go for using getter and setter methods with different keys
for the viewstate.
You can have a unique key with 'this.ID', which give you the webpart 'guid'.
If you want to share similar logic between webparts or controls in general, you can also create a static 'helper' class.
this refers to current instance of a class. So this.ViewState refers to viewstate of the control\webpart. So, logically you are wrong here as you are trying to retrieve from the place where you never stored!
Now speaking practically, Because the ViewState property is marked as protected, you can't get a control's ViewState in another.
If you want to share ...