Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is some simple example how to filter requests by extension... the example below exclude from the processing files with the specific extensions. Filtering by file name will look almost the same with some small changes...</p> <pre><code>public class AuthenticationModule : IHttpModule { private static readonly List&lt;string&gt; extensionsToSkip = AuthenticationConfig.ExtensionsToSkip.Split('|').ToList(); // In the Init function, register for HttpApplication // events by adding your handlers. public void Init(HttpApplication application) { application.BeginRequest += new EventHandler(this.Application_BeginRequest); application.EndRequest += new EventHandler(this.Application_EndRequest); } private void Application_BeginRequest(Object source, EventArgs e) { // we don't have to process all requests... if (extensionsToSkip.Contains(Path.GetExtension(HttpContext.Current.Request.Url.LocalPath))) return; Trace.WriteLine("Application_BeginRequest: " + HttpContext.Current.Request.Url.AbsoluteUri); } private void Application_EndRequest(Object source, EventArgs e) { // we don't have to process all requests... if (extensionsToSkip.Contains(Path.GetExtension(HttpContext.Current.Request.Url.LocalPath))) return; Trace.WriteLine("Application_BeginRequest: " + HttpContext.Current.Request.Url.AbsoluteUri); } } </code></pre> <p>General idea is to specify in config file what exactly should be processed (or excluded from the processing) and use that config parameter in the module.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload