Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

Web Config Error Handling

In my Web.Config I have the code at the bottom.

Is there any cleaner way to handle this?

When they get directed to the OOPS page, I display a message of what kind of error it is.

      <customErrors mode="On" defaultRedirect="~/ErrorPages/oops.aspx?type=error">
            <error statusCode="403" redirect="~/ErrorPages/oops.aspx?type=403"/>
            <error statusCode="404" redirect="~/ErrorPages/oops.aspx?type=404"/>
            <error statusCode="405" redirect="~/ErrorPages/oops.aspx?type=405"/>
            <error statusCode="406" redirect="~/ErrorPages/oops.aspx?type=406"/>
            <error statusCode="408" redirect="~/ErrorPages/oops.aspx?type=408"/>
            <error statusCode="409" redirect="~/ErrorPages/oops.aspx?type=409"/>
            <error statusCode="500" redirect="~/ErrorPages/oops.aspx?type=500"/>
            <error statusCode="503" redirect="~/ErrorPages/oops.aspx?type=503"/>

Open in new window

Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Larry Brister


I always enjoy your advise.