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

How do I connect my ASP.net application to MySQL database?

In general, 2 different methods can be used to connect an ASP.net application to MySQL database....

I get an error 'A potentially dangerous Request.Form value was detected from the client ' when I hit submit on my ASP.NET Webform. What can I do?

This error is caused by a newly introduced feature of .NET Framework 1.1, called "Request...

Disable Web Config inheritance for Virtual Application

If you have a lot of virtual applications under your webisteYou can Disable the main website's...

How can I send email from ASP.net if SMTP Authentication is required for your mail Server?

Our SMTP Server requires authentication before you can send email, But If your ASP or ASP.net...

I receive an error when trying to access an ASP.NET page within a subweb. What do I do?

The ASPNet (user as which ASP.NET runs) user permission does not inherit into the subweb....