views:

83

answers:

1

I would like to read all content that's been written to the output stream. I'm attempting to do this using an HTTP module, and it seems like the obvious timing would be when handling the PreSendRequestContent event.

However, if the output stream seems to be set to write-only, as I can't read using a StreamReader. Is there a way I read and re-write the content without writing my own IIS module?

+2  A: 

Look at the HttpResponse.Filter property.

John Saunders
Nice. Not sure how I didn't notice that there :D
Daniel Schaffer
@Daniel: I've never seen it actually used, but remembered seeing it in the documentation.
John Saunders