I am storing some values in ViewState in my WebPart user control in SP2013. After some idle time, say 40 minutes when I try to access those values from ViewState i always get null result. Is it due to session expires and it also make ViewState blank causing this behavior. Can someone please guide me on this topic.



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

Increasing this time out might have some performance implications.

Kindly check below article.

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

  • Did you get it working? – Hardik Jul 1 '16 at 10:23
  • Thanks, I think this is what I need to change. Thanks again. You saved my day :) – Nikhil Chavan Jul 1 '16 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.