ViewState in Web Part And Custom Page SharePoint

I was using ViewState in custom developed SharePoint Solution to store date before saving to List because of some requirements. I found that the ViewState value was getting null after some duration which again was unable to meet my requirements. I went through some blogs and found that ViewState is cleared after some duration in SharePoint.

So I Found that 30 minutes by default and then SharePoint ViewState is cleared after.

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 -Minutes 0
$webApp.Update()

Increasing this time out might have some performance implications.

Nice Article Please check this for details.

AppFabric Caching (and SharePoint): Configuration and Deployment (Part 2)

 

Advertisement

One thought on “ViewState in Web Part And Custom Page SharePoint

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s