views:

31

answers:

1

I intend to build a HttpModule in order to scan a response's source and make small adjustments, mainly altering urls (hrefs, actions, srcs, etc).

I see the HttpApplication has a plethora of events that can be handled and I'm not sure of the best stage at which it's safe to alter the HTML content that goes back to the browser.

I need to do this in a HttpModule because this is an application-wide processing that spares me of writing the same code in every page.

A: 

You could use a response filter that you could attach during BeginRequest. And here's a nice video.

Darin Dimitrov
That's what I was going to do (use a response filter) but I was wondering if it makes any difference over what application event I'm using for hooking it up. You say `BeginRequest`, I've seen examples using `ReleaseRequestState`.
CyberDude
OK, I figured that as long as you hook the filter before it's being called (no later than `ReleaseRequestState`) it doesn't matter at what step you do it.
CyberDude