After installing .NET Framework 2.0 sp1, PostRequestHandlerExecute
am 14.04.2008 05:22:23 von XiumingDear All:
I encount a problem after installing .NET Framework 2.0 sp1, anyone
can help?
I ever wrote a HTTP Module and provided a few event handler, including
PostRequestHandlerExecute event. I deployed this module in WebApp
which not only including WebPages but also some WebServices. Before I
install latest .NET Framework 2.0 sp1, all things are fine, but after
that, I found that when an aspx resource is visited the event never
fires again, but when an asmx resource is visited, the event DOES
fire!.
I checked my codes and found that if I call response.End() method in
page processing, the event stops working, but before installing .NET
Framework 2.0 sp1 this never happened.
Has Microsoft engineers changed the ASP.NET processing rules? or is
this a bug?
Below is some relevent codes:
#region IHttpModule Members
public void Dispose()
{
}
public void Init(HttpApplication context)
{
this._customErrors = GetWebCustomErrorsSection(context);
context.BeginRequest += new
EventHandler(context_BeginRequest);
context.AuthenticateRequest += new
EventHandler(context_AuthenticateRequest);
context.AuthorizeRequest += new
EventHandler(context_AuthorizeRequest);
context.PreRequestHandlerExecute +=new
EventHandler(context_PreRequestHandlerExecute);
context.PostRequestHandlerExecute += new
EventHandler(context_PostRequestHandlerExecute);
context.PreSendRequestHeaders += new
EventHandler(context_PreSendRequestHeaders);
}
#endregion
void context_PostRequestHandlerExecute(object sender,
EventArgs e)
{
HttpApplication app = sender as HttpApplication;
app.Response.Filter = new AuthFilter(app.Response.Filter,
app.Response, this);
}