views:

294

answers:

1

Ok So i have written methods to override the LoadPageStateFromPersistenceMedium and SavePageStateToPersistenceMedium methods. now the problem is that i am using a masterpage, so how do i maintain using my masterpage and still inherit from System.Web.UI.Page?

Please bear in mind that the .vb Code behind the masterpage already inherits System.Web.UI.MasterPage. Anybody know how i can "properly" override these methods in a MasterPage?

A: 

You don't override those in the master page. It's still the Page object that is the main object for the page, the master page is actually just a user control in the page.

Guffa
ok fair enough. so how will i make use of my methods then? the methods i wrote override the ones from page, now how does my page call these? because with a break point on those specific methods, it seems they aren't getting called, and my viewstate is present on the page source
moonblade
If you are using framework 1 that should work. If you are using framework 2 or later you haven't actually overridden the methods, as they are internal so they can't be overridden. To do this you instead create a class that inherit from PageStatePersister. Example: http://msdn.microsoft.com/en-us/library/system.web.ui.pagestatepersister%28VS.80%29.aspx
Guffa
using .Net 2.0 so i guess that means i must use PageStatePersister.will try that and report back on my results
moonblade
thank you, using PageStatePersister as a page adapter i got pretty much what i wanted.
moonblade