Thursday July 30th

Wednesday July 29th

Use Response.Filter to intercept your HTML

You can use Response.Filter to get a reference to the final HTML that will be sent to the client

2 comments

I admit that i didn't know about the Filter property; but, in all honesty, I really can't think of any reason that I'd actually use this in a production environment. I realize that this sample was just to prove a point, so can anybody give a good reason that you would want to do this?

I use it to alter the HTML that a 3rd party component outputs. I don't have direct access to change this from the control itself so this was an easy way of manipulating the HTML. This could have also been done with a httpModule (or on each page by overriding the page's Render method) however, I thought this was a more suitable approach as I could just apply it to whichever pages I wanted with one line of code.

Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network