I figured it out... still using Response.Filter
HttpResponse res = HttpContext.Current.Response;
if ( res.ContentType == "text/html" ) {
res.Filter = new CensorFilter(res.Filter);
res.Filter = new HightLightFilter(res.Filter);
}
In fact there was nothing to figure out... It just works :-D
"Thomas" <ma******@opcon.no> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
Thx!
This solves my problem... almost ;-)
What if I want to implement more than one filter... lets say I have a
SearchHighlightModule and a WordCensorModule ... The Response object can
only supprt one filter... I was hoping to be able to do this directly from
the httpmodule, but maybe that is impossible...
"John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message
news:Ot**************@TK2MSFTNGP10.phx.gbl... example here
http://flaky.dk/aspnet_httpmodule_charrewrite.html
--
Regards
John Timney
Microsoft Regional Director
Microsoft MVP
"Thomas" <newsma******@opcon.no> wrote in message
news:O8*************@TK2MSFTNGP11.phx.gbl... I want to be able to implement a filter that manipulates the output
from the server... Maybe replacing some words, or highlighting a search string, or some other fancy feature...
I want to make this code reusable to all my applications, and by
making this as a HttpModule I can implement this feature on existing .Net
applications by editing the we.config and nothing else...
My problem is that that I can't get this to work.
Some pseudo-code:
public class PostProcessingModule : System.Web.IHttpModule {
public void Init(System.Web.HttpApplication context) {
// What event should i use ....
// How do I reference the output and replace values
// How do I write my own manipulated stuff to the client
}
public void Dispose() {}
}