ASP.Net: Server.Transfer() results in HttpModule ReleaseRequestState handler not being called?

We have a response filter that intends to filter the text looking for urls to ensure querystrings are encrypted. We have an http module implementing a ReleaseRequestState handler where we attach the filter to the Response object.

We discovered an oddity whereby one .aspx page doing a Server.Transfer() to another in the same app results in the ReleaseRequestState handler never being run, so consequently our output filter never gets attached.

The setup predates me, so I don't know why the filter was hooked up in ReleaseRequestState, but I'm puzzled why doing a Server.Transfer would result in that event never firing. Anyone have any ideas?

Thanks

Answers


Per MSDN, Server.Transfer internally calls Response.End, which skips all remaining pipeline events and jumps straight to EndRequest.

EndRequest is indeed the only pipeline event that is ever guaranteed to be run during an ASP.NET request (assuming its containing module is registered properly in config) precisely because every other event can be bypassed via a call to Response.End or HttpApplication.CompleteRequest.

You may wish to consider hooking your filter earlier in the pipeline to minimize the chance of some other component skipping its invocation.


Need Your Help

How do you place controls on the chrome of a WPF Window when the user is on Windows XP?

c# wpf windows-vista windows-xp dwm

How can you place controls on a frame of a WPF window? I took a look at this but I don't know how to do this in WPF. link textThe problem comes when The application has to run on Windows XP where t...

Python: EasyGui freezes with fileopenbox()

python-2.7 easygui

I'm writing a code to open a PDF file, select the number of pages to crop, and then create a new cropped file.