For all Interested, I want to add a solution on how to get rid of Viewstate data on clientide. This gives the server additional load, but if you are in the same situation as me and you have a lot of server power and you need to take the load on the client, itβs nice.
Let all your pages be derived from BasePage.cs, which look like this
public class BasePage : System.Web.UI.Page { protected override void SavePageStateToPersistenceMedium(object viewState) { string vsKey = String.Format("VIEWSTATE_{0}_{1}_{2}", base.Session.SessionID, Request.RawUrl, DateTime.Now); Session.Add(vsKey, viewState); ClientScript.RegisterHiddenField("__VIEWSTATE_KEY", vsKey); } protected override object LoadPageStateFromPersistenceMedium() { string vsKey = Request.Form["__VIEWSTATE_KEY"]; return Session[vsKey]; } }
Now you have the key to the viewstate data session instead of the view in your code ...
Works like a charm for me on a site with 1000-1200 daily visitors.
The real napster
source share