How to hook extensions to final page processing

Topics: Business Logic Layer
Jan 11, 2008 at 12:30 PM

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 12:52 PM
I don't know how to do it either, but I have a similar requirement.
Sep 2, 2008 at 1:02 AM
did anyone figure this out?
Oct 9, 2009 at 11:29 PM
Edited Oct 9, 2009 at 11: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