ResponseFilterStream class seems to work fine for me. I have implemented it in an HTTPModule and using its functionality in "PostRequestHandlerExecute" event.
Since the module executes for every request, I want it to get executed when a request comes for only certain pages.
An HTTPHandler can easily be configured through a web.config to work only as per the mapping done in the web.config. Unfortunately, I couldn't get the Handler to work with the ResponseFilterStream, as it doesn't show the output of the original page the user
had requested and instead shows an empty page. I think it could be because the Handler is getting executed instead of my page (which is another Handler). I hope I am not confusing anyone here.
Since the Handler executes prior to the page processing so that tends me to think that that is probably why I don't see any output of the page that was originally requested through the browser.
How can I have a Handler work with an HTTPModule so that the HTTPModule can be executed only for those requests or pages which are mapped in the web.config for the Handler.
It would be very helpful if this is doable as I would not be wasting the server resources by getting my HTTPModule executed on every request.
raringsunny
Member
133 Points
109 Posts
Re: HTTP Handler to capture HTML Content
Oct 28, 2011 12:48 AM|LINK
ResponseFilterStream class seems to work fine for me. I have implemented it in an HTTPModule and using its functionality in "PostRequestHandlerExecute" event.
Since the module executes for every request, I want it to get executed when a request comes for only certain pages.
An HTTPHandler can easily be configured through a web.config to work only as per the mapping done in the web.config. Unfortunately, I couldn't get the Handler to work with the ResponseFilterStream, as it doesn't show the output of the original page the user had requested and instead shows an empty page. I think it could be because the Handler is getting executed instead of my page (which is another Handler). I hope I am not confusing anyone here.
Since the Handler executes prior to the page processing so that tends me to think that that is probably why I don't see any output of the page that was originally requested through the browser.
How can I have a Handler work with an HTTPModule so that the HTTPModule can be executed only for those requests or pages which are mapped in the web.config for the Handler.
It would be very helpful if this is doable as I would not be wasting the server resources by getting my HTTPModule executed on every request.
--raringsunny