locked
IhttpHandler RRS feed

  • Question

  • User-1161463277 posted

    Hi im trying to use a IHttpHandler to automatically add content to the webpage before displaying it to the user. I need to replace some text that appears on every page with html. Is there an easy way of doing this as i've been trying to attempt to do this for a couple of days now.

    Thanks

    Tuesday, March 21, 2006 11:54 AM

Answers

  • User1090950853 posted

    You should use HttpModule to accomplish this task.

    It will allow you to catch events of the request pipeline for performing custom tasks.

    In case you need just to append some text to each page leaving to client then handle EndRequest event of the application object.

    If you need to replace/append some text then you will need to use Response.Filter property.

    Here you can find some good examples.

    I'm using this in my own applicatons.

    Hope this helps 

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 21, 2006 3:26 PM