locked
ASP.NET CustomRequestValidator not validating requests with non dangerous characters RRS feed

  • Question

  • User46076047 posted

    As we know, ASP.NET RequestValidator only works on http requests that contains dangerous characters that not encoded.

    I would like to validate all the request fields even if they doesn't contains dangerous strings. Therefore, i tried to create a custom RequestValidator class but i can only override the method IsValidRequestString to do the validation and as i mentioned above, the method is not executing when the request does not contains dangerous characters.

    in the RequestValidator document, i noticed that there is a method called InvokeIsValidRequestString but its not a virtual so i can not override it.

    Is there an option to allow the overrided IsValidRequestString to be executed for every request? is there an option to override the InvokeIsValidRequestString method somehow?

    Thursday, December 7, 2017 8:57 AM

All replies

  • User475983607 posted

     Validation in ASP.NET is handled using validation controls.  Why are you creating a custom request validator?

    Thursday, December 7, 2017 12:02 PM