Enable detailed error in ASP and ASP.Net

With ASP and ASP.Net script, IIS is configure to disable any error for security concern. If you are in development stage, you could enable them from your web.config file without access to the server/control panel.

By fault, if you hit any error from your ASP/ASP.Net script, you shall receive error 500 Internal Server Error.

First of all, you should enable detailed error from your web.config file. To do this, enter the following command,
<system.webServer>
<httpErrors errorMode=”Detailed” />
</system.webServer>

Now, detailed error is enabled but you will found out the ASP/ASP.Net is still showing Error 500, Internal Server Error.To fix it,

For ASP.Net,
Find the system.web section or create it with,
<system.web>
<customErrors defaultRedirect=”errors.aspx” mode=”Off” />
</system.web>

For ASP,
Find the system.web section or create it with,
<system.web>
<asp scriptErrorSentToBrowser=”true” />
</system.web>

Classic ASP script error messages are no longer shown in a Web browser by default

With IIS 7.x, ASP error is disabled by default. Hence, the web programmer will not know what is the detailed error from your scripting and the following error shown.

An error occurred on the server when processing the URL. Please contact the system administrator.

To work around this problem, you could set the detailed error through IIS or web.config file.

Method 1:

1. Open IIS or run inetmgr.
2. Click on the websites.
3. Click on the ASP icon.
4. Expand the Debugging Properties.
5. On Send Errors To Browser parameter set to True.

Method 2:

Open your web web.config file, add the following command.

<configuration>
<system.webServer>
<asp scriptErrorSentToBrowser="true" />
</system.webServer>
</configuration>

Method 3:

Run the following command to enabled from server end.

%windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true