Need to optimize your ASPX pages for Search Engines like Google? One thing You have to do is to minimize or delete the viewstate hidden input field. Please find the solution below.
public class BasePage : 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];
}
}
Showing posts with label page viewstate. Show all posts
Showing posts with label page viewstate. Show all posts
Monday, July 2, 2007
Subscribe to:
Posts (Atom)