From Microsoft: Displaying a Custom Error Page (C#):
When an unhandled exception arises in an ASP.NET application one of three types of error pages is displayed:
- The Exception Details Yellow Screen of Death error page,
- The Runtime Error Yellow Screen of Death error page, or
- A custom error page
Short version:
- Create a custom web page in your ASP.NET web app.
Add customErrors markup to the
configuration
->system.web
section of your application's web.config file:<system.web> <customErrors mode="RemoteOnly" defaultRedirect="~/ErrorPages/Oops.aspx" /> </system.web>
See the above link for additional information on how to do it, as well as how to add custom pages for individual HTTP status codes, etc.