I have a complicated, very involved ASP.NET WebForm with a large ViewState. Currently, to lower impact in the browser (by shrinking the __VIEWSTATE hidden input field), I use a PageAdapter and SessionPageStatePersister to store the ViewState within the Session.
However, I want to change my session mode from InProc to StateServer, so that I can both lower my RAM usage and avoid site restart and application pool recycling issues. Will I need to pull the ViewState back out of the Session? Or can it remain as is?
In the future, I’ll want to load balance, also, but I heard that I could just use “sticky sessions”, so that might not force me into StateServer.
NOTE: I’m currently using .NET 2.0 (Integrated), but I’m open to updating that.
SessionPageStatePersisterstores your Viewstate in the Session object wherever your Session happens to be stored. It’s completely agnostic about whether your session is InProc, SQL or StateServer, it should just keep working without you having to do anything.