I'm trying to display some customized error messages to the end user in my web application.
General error codes work fine with the following code in Web.config file:
<system.web>
<customErrors mode="On" defaultRedirect="~/Error">
<error redirect="~/Error/NotFound" statusCode="404" />
</customErrors>
</system.web>
But i'm having difficulty redirecting specific error codes documented here.
I tried with <error redirect="~/Error/AccessDenied" statusCode="403.1" /> but the IDE highlights the line as
The value '403.1' is invalid according to datatype 'Int' - The string '403.1' is not a valid Int32 value.
I know that the message is self explanatory, but I'm not quite sure how to tackle this. I don't have pages for each error, just want a separate page for each series like 400.x, 401.x, 500.x etc.