title: asp.net 4 custom request validator doesn't seem to work
body: <p>i am following the example at <a href="http://msdn.microsoft.com/en-us/library/system.web.util.requestvalidator.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.web.util.requestvalidator.aspx</a> but it doesn't seem to work and i still get error. Here is my class and how i add it to webconfig </p>
  
  <p>my webconfig: </p>
  
  <pre><code>     &lt;httpRuntime requestValidationType="CustomRequestValidation"/&gt;
  </code></pre>
  
  <p>my class:</p>
  
  <pre><code>public class CustomRequestValidation : RequestValidator
  {
  public CustomRequestValidation() { }
  protected override bool IsValidRequestString(HttpContext context, string value,   RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex)
  {
      validationFailureIndex = -1;
      if (requestValidationSource == RequestValidationSource.Path)
      {
          // value "&amp;","="  allowed.
          if (value.Contains("&amp;") || value.Contains("="))
          {
              validationFailureIndex = -1;
              return true;
          }
          else
          {
              //Leave any further checks to ASP.NET.           
              return base.IsValidRequestString(context, value, requestValidationSource, collectionKey, out validationFailureIndex);
          }
      }
      else
      {
          return base.IsValidRequestString(context, value, requestValidationSource, collectionKey, out validationFailureIndex);
      }
  
     }
   }
  </code></pre>
  
  <p>Error details are:</p>
  
  <pre><code>System.Web.HttpException
  A potentially dangerous Request.Path value was detected from the client (=).
  System.Web.HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (:).
     at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
     at System.Web.HttpApplication.ValidateRequestExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)
  </code></pre>