title: IIS 7 integrated pipeline - modifying the response HTML
body: <p>I'm trying to write an IIS extension that modifies the response HTML for a request as it is sent back to the client.  I know that traditionally this would be the work of an ISAPI filter however I'm a .Net developer and I've read that implementing an ISAPI filter in .Net <a href="http://blogs.msdn.com/b/jpsanders/archive/2009/08/03/writing-an-isapi-filter-with-net-managed-code-is-not-supported-by-microsoft.aspx" rel="nofollow">is a bad idea</a>.</p>
  
  <p>I have read in a few places that the shiny new integrated pipeline mode of IIS 7 should now allow me to writes modules in .Net that provide the same functionality as ISAPI filters by implementing <a href="http://msdn.microsoft.com/en-us/library/system.web.ihttpmodule.aspx" rel="nofollow">IHttpModule</a>, however I can't work out how to modify the response HTML for non ASP.Net requests.</p>
  
  <p>The only resource I have found on how I might do this is <a href="http://aspnetresources.com/articles/HttpFilters" rel="nofollow">this article</a> however this doesn't appear to work for non ASP.Net resources or in cases where <code>HttpApplication.CompleteRequest</code> is called, even if the integrated pipeline mode is enabled.</p>
  
  <p><strong>How can I write an IIS module in C# that allows me to modify the response html / data for <em>all</em> requests?</strong></p>