-
-
Save naik899/96efa72240e2b9c7b77e10fbf529f8cc to your computer and use it in GitHub Desktop.
HttpModule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web; | |
namespace HtmlMinification | |
{ | |
public class HttpModule : IHttpModule | |
{ | |
void IHttpModule.Init(HttpApplication context) | |
{ | |
context.BeginRequest += ContextBeginRequest; | |
} | |
private void ContextBeginRequest(object sender, EventArgs e) | |
{ | |
HttpApplication app = sender as HttpApplication; | |
if (app != null) | |
if (app.Request.RawUrl.Contains(".aspx")) | |
{ | |
app.Response.Filter = new WhitespaceFilter(app.Response.Filter); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment