I'm looking for a way to intercept the ASP.NET processing pipeline in such a way to be able to register event handlers to all events on the Page
class. The reason is, I need to maintain a session-bound instance of a component that needs to be notified of all important Page
events, starting from OnPreInit
.
There's an arbitrary number of Page
descendants in the application, which are not under my control. Hence I cannot use an approach like using a single custom descendant, that would notify the session-bound component, as a base class for all pages in the web application.
I don't think creating a custom IHttpHandler
or IHttpModule
implementation would solve the problem. Also note I cannot create a custom HttpApplication
descendant.