mardi 28 avril 2020

ASP.net - Custom error page for error 400

I am doing custom error pages for errors in ASP. I did the following lines to web.config.

<customErrors mode="On" defaultRedirect="~/Shared/Error">
  <error statusCode="404" redirect="~/Error/PageNotFound" />
  <error statusCode="400" redirect="~/Error/BadRequest" />
</customErrors>

Error 404 works fine and redirects me to the correct page however error 400 does not redirect me to its page.. Am I doing something wrong please?




Aucun commentaire:

Enregistrer un commentaire