How to hook extensions to final page processing

Topics: Business Logic Layer
Jan 11, 2008 at 11:30 AM

currently i'm writing an extension that needs to get access to the whole page content after all other stuff like posts, articles etc. is rendered. I need to hook in just before the site is sent back to the browser. I haven't found a way to hook my extension to this stage of page processing. The only events i found were those like Post.Serving, Comment.Serving and so on. Is there any way to get this done?
Apr 7, 2008 at 11:52 AM
I don't know how to do it either, but I have a similar requirement.
Sep 2, 2008 at 12:02 AM
did anyone figure this out?
Oct 9, 2009 at 10:29 PM
Edited Oct 9, 2009 at 10:29 PM

Hi, I could think of... 

static MyExtension() {
   BlogEngine.Core.Page.Serving += new EventHandler<ServingEventArgs>(Serving_Event);
Post.Serving += new EventHandler<ServingEventArgs>(Serving_Event);

private static void Serving_Event(object sender, ServingEventArgs e) {
   BlogBasePage serving_page = HttpContext.Current.CurrentHandler as BlogBasePage;
   if (serving_page == null) return;

   serving_page.LoadComplete += new EventHandler(DoSomething);

private static void LoadComponents(object sender, EventArgs e)
   BlogBasePage basePage = sender as BlogBasePage;
   // Do something with the page when it has loaded completely; Remember that BlogBasePage inherits also from Page