Display Detailed Errors in ASP.net Apps

Errors are common on any application. With ASP Applications it is hard to tell what caused an error, since default errors are not specific enough and won’t tell you what went wrong. In this article I will show you on a step-by-step guide how to display detailed errors in ASP.net applications

1

Default errors ASP.net

1. Open the web.config of your application.

2. In the web.config file, look for the <system.web> section. Inside this section we will use the <customErrors> tag. This tag offers three modes which are:

Off Mode
This mode is responsible for displaying error message on local and remote server in case of an error.
On Mode
This mode is responsible for displaying custom error page with message on local and remote server in case of an error. By using this mode, we can show our own custom error messages page for specific errors on local and remote server.
RemoteOnly
This mode is responsible for displaying error message on remote server only in case of an error. By using this mode, we can show our own custom error messages page for specific errors on remote server only.

In this case, we will use the off setting to get detailed errors:

<customErrors mode “off”></customErrors>

2

3. Save the changes and update your ASP Application.

4. That’s it, now you will get a detailed error page:

3

It is very important to have this setting, because if you ever get an error in your application, you won’t spend time finding out what caused the error.

This concludes Display detailed errors in ASP.net apps.

Looking for quality ASP Web Hosting? Look no further than Arvixe Web Hosting!

Happy Hosting!

Rodolfo Hernandez

Tags: , , , , , , , , , , , , , , , , , | Posted under ASP .NET 3.5, DotNet/Windows Hosting | RSS 2.0

Author Spotlight

Rodolfo Hernandez

Rodolfo Hernandez

I like photography and reading books. Currently working for Arvixe as Elgg Community Liaison. Elgg Security Expert Web Security Expert CEO of UDP SW Social Web

Leave a Reply

Your email address will not be published. Required fields are marked *


7 − = 4

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>