InnerPostRequestHandlerExecute Method Wrong...

Topics: Web Client Software Factory
May 15, 2007 at 5:04 PM
Helping these guys out with their customization just made me realize how wrong this method is currently written.

Here it is now:

protected void InnerPostRequestHandlerExecute(IHttpContext context)
{
    if (HttpRequestHelper.IsHandledByPageHandlerFactory(context.Request.Url.ToString()))
    {
        ICompositionContainer moduleContainer = this.GetModuleContainer(context);
        this.PageBuilder.TearDown<IHttpHandler>(moduleContainer.Locator, context.Handler);
    }
    if (context.Handler is Page)
    {
        this.PostPageExecute(context.Handler as Page);
    }
}

It should be:

protected void InnerPostRequestHandlerExecute(IHttpContext context)
{
    if (HttpRequestHelper.IsHandledByPageHandlerFactory(context.Request.Url.ToString()))
    {
        if (context.Handler is Page)
        {
            this.PostPageExecute(context.Handler as Page);
        }	
        ICompositionContainer moduleContainer = this.GetModuleContainer(context);
        this.PageBuilder.TearDown<IHttpHandler>(moduleContainer.Locator, context.Handler);
    }
}

This keeps it consistent with the InnerPreRequestHandlerExecute Method.

Regards,

Dave

_____________________________

David Hayden
Microsoft MVP C#