Filter.NET has a simple configuration file located at %SYSTEMROOT%\Filter.NET\[version]\bin\filter.config. The directory where this file is located is also the same directory where all managed filters are expected to be located (besides the GAC).

The configuration file format is:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  
  <configSections>
    <section name="httpFilters"
             type="KodeIT.Web.Configuration.HttpFiltersSection, KodeIT.Web, 
             Version=1.0.1.0, Culture=neutral, PublicKeyToken=18823f5c6a796933" />
  </configSections>

  <httpFilters>
    <!-- 
      Add here the managed filters
      
      <add name="myManagedFilter" type="MyNamespace.MyClass, MyAssembly" />
    -->
  </httpFilters>

</configuration>


The <httpFilters> tag has some useful attributes - errorDetail and errorPage - to define when to show error pages and what the error pages should look like. The available optional attributes are:

<httpFilters errorDetail="On|Off|LocalOnly" errorPage="somePage.htm">
</httpFilters>


As the snippet above shows, you can display errors with detail or without detail. You can also only display them when the request is made from the same box where IIS is located.

Last edited Sep 3, 2007 at 11:21 PM by thalm, version 5

Comments

No comments yet.