How do I setup custom error for my ASP.net application?

ASP.net has its own built-in error handling. To set up custom error handling for your ASP.net application, you will need to modify your web.config file.

As an example, if you want to redirect all 404 errors to error404.aspx, 500 errors to error500.aspx, and all other errors to error.htm, you would update the customErrors element in your web.config file.

CustomErrors is set to Off by default on all our servers. If you do not customize the custom error element in the web.config file, the default ASP.net error (with debug information) will be displayed.

Was this answer helpful?

 Print this Article

Also Read

Why can I still access my ASP.NET pages even though I disabled anonymous access to my directory?

After disabling anonymous access in the permission manager in the control panel, ASP.net pages...

I get a configuration error when I execute my application in a subdirectory. How do I resolve this?

This error may occur if the application is being run out of a subfolder and the subfolder is not...

After I configure the custom error setting in the control panel, I still get the generic error page?

Custom error setting is a web server setting that sets your website Error Pages, but you can...

How do I get my ASP.net application to display non-English language

...

I get an error "Access denied to 'D:\public_html\xxx\xxx\web.config'. Failed to start monitoring file changes" when I try to open an ASP.net page. What can I do?

This error usually means that the ASPNet user does not have adequate permission to access the...