showing asp class errors in asp.net website

I have a web server setup for asp.net website 4.5 framework.
Someone is wanting to run an asp classic web page on the site. It gets 500 internal server errors under certain circumstances. I'd like to be able to see the actual error message.

I put debug=true in the asp.net web.config which did not help.
so what do I need to setup on the server for this asp classic page to show an actual error message.
thank you.
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontyWeb Ninja at largeCommented:
There a setting in IIS to send errors to the browser, see the article below for detailed instructions

http://www.chestysoft.com/asp-error-messages.asp
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
The first thing you need to make sure is classic asp is turned on.  Wayne has this detailed http://www.experts-exchange.com/articles/3730/Setting-up-IIS7-5-in-Windows-7-to-run-Classic-ASP-Web-Sites.html as does the iis.net site http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-not-installed-by-default-on-iis.  

Assuming that is done, you need to at least turn on errors.  In IIS, go to the ASP section and "send errors to browser" should be set to true.  Debugging set to true does not do this. http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-default

However, sending these detailed errors to the browser should only be done while developing and not in production.  An easy alternative is to catch the errors.

At the top of the page below
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% On Error Resume Next %>

Open in new window

Then at the bottom of the page
<%
If Err.Number <> 0 Then
   Response.Write (Err.Number&" "&Err.Description)
end if
%>

Open in new window

Again, you only want these errors to show while not in production.

What he can do is
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="/top_level_includes_folder/error_top.asp"-->

Open in new window

Then at the bottom of the page
<!--#include virtual="/top_level_includes_folder/error_bottom.asp"-->

Open in new window


error_top.asp
dim site_status
site_status="testing" ' or production
if site_status ="testing" then
     On Error Resume Next ' only trap errors in testing
end if

Open in new window

error_bottom.asp
if site_status ="testing" then
   If Err.Number <> 0 Then
          Response.Write ("<hr>"&Err.Number&" "&Err.Description)
          response.end ' make sure nothing else processes
     else
        Response.write "************<br>WARNING: TESTING MODE<br>************"
   end if
if site_status ="testing" then

Open in new window

This way, when the site is in testing, he only needs to upload error_top.asp once then when the site is in production change site_status="testing" to site_status="production" ' or anything but testing.  And make sure those include files are on every page.  This method is probably the safest way to go.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
thanks!
tgritterCommented:
I recently implemented Scott Fell's error catching solution because I had a similar situation to what BobCSD described in his question,  This solution worked very well for me and saved me tons of debugging time and frustration. Many thanks to Scott and Experts Exchange!
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
tgritter, thank you very much for the update!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.