I created a simple HttpModule that removes spaces from a response before sending it to the client. This works fine for an aspx page in IIS7.0, but if I create a static html page and call it, the HttpModule will not beat (as I know, because the source contains spaces that would otherwise have to be removed). There seems to be something that I am not doing right, but I don’t know what.
My site is in the application pool with .NET 4.0 and ManagedPipelineMode = Integrated.
I added my module as a ManagedModule and refers to a build with a strong name from the GAC.
thank
Edit is the part of system.webserver from web.config
<system.webServer>
...
<modules runAllManagedModulesForAllRequests="true">
<add name="RemoveWhitespaceHttpModule"
type="HttpModules.Modules.RemoveWhitespaceHttpModule, HttpModules,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=8a83u4bi47o9fo0d"
preCondition="" />
</modules>
<defaultDocument>
<files>
<add value="TestForm.aspx" />
</files>
</defaultDocument>
</system.webServer>
. . , , , , ,
if (contentType.Equals("text/html")
&& httpContext.Response.StatusCode == 200
&& httpContext.CurrentHandler != null)
{ ... }
httpContext.CurrentHandler!= null. .html currentHandler , , , , html. , .