ASP.NET Master Page View State Persistance Issue

I'm trying to use PageStatePersister solution (found at http://msdn.microsoft.com/en-us/library/aa479403.aspx) in order to decrease the size of page View State. I've added the code lines attached to this question on code behind of every page but it did not decreased the size of View State on any page. Where as on one of my other similar application this worked fine.

The only issue i can clue about is that the pages are specified with a Master page file and i'm unable to override the PageStatePersister for Master Page (the error comes with description like 'no suitable method found to override').

Please let me know how can i decrease Page View State size of an .aspx page which has a Master Page specified.

Regards.
protected override PageStatePersister PageStatePersister
{
    get { return new SessionPageStatePersister(this); }
}

Open in new window

23-degreesAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
xav056Connect With a Mentor Commented:
create a base page where all your regular pages will inherit from
and in this base page add your methos
protected override PageStatePersister PageStatePersister
{
    get { return new SessionPageStatePersister(this); }
}

just make sure to move it from the master page code behind and make every page in your application inherit from
basepage which in turn inherits from System.Web.Ui.Page
0
 
23-degreesAuthor Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.