PageStatePersister

  • Thread starter Thread starter PhatTim
  • Start date Start date
P

PhatTim

I'm extending the asp.net 2.0 page class to use a pagestateadapater,
and thereby am attempting to "roll my own" pagestatepersister. But I
keep getting the error "No overload for method PageStatePersister,
takes '0' arguments" when attempting to build the following very basic,
simple class. Any ideas? Thanks much.

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.IO;

namespace AnnawareViewState
{
public class AnnawarePage : System.Web.UI.PageStatePersister
{
public AnnawarePage(Page myPage)
{
}

public override void Load()
{
}

public override void Save()
{
}
}
}
 
The error message is a bit misleading.

What it is trying to tell you is that the PageStatePersister class
constructor requires a parameter, you can pass along the myPage
parameter like so:

public AnnawarePage(Page myPage) : base(myPage)
{

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top