1

I am a complete novice to Classic ASP and have been trying to set it up, but I keep running into an error message. I am using IIS7 on Windows 7 and have made sure that IIS is installed, etc. I have created an application that resides in C:\inetpub\wwwroot and in that directory I have a file called page.asp. However, whenever I go to my browser which is Chrome and type in localhost it shows me the blue IIS page but when I type in localhost/page.asp it gives me the following error message:

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

I cannot figure out what I am doing wrong. I have made sure that ASP and IIS are both enabled, and the code in the page is a simple

<html>
<%Response.Write("Hello world")%>
</html>

Can you please help me?

user692942
  • 16,398
  • 7
  • 76
  • 175
Raghav Malik
  • 751
  • 1
  • 6
  • 20
  • 1
    FYI, this is ASP.NET, not "ASP". – John Saunders Mar 05 '14 at 00:25
  • My mistake. It should actually be tagged as "ASP" as in "Classic ASP" no "ASP.NET". Would it make a difference though? – Raghav Malik Mar 05 '14 at 03:53
  • Yes, totally. The software is 100% different. – John Saunders Mar 05 '14 at 08:16
  • You probably need to setup the ASP Handler I don't think it's enabled by default in IIS 7. I'll post an answer when I get 5 minutes. – user692942 Mar 05 '14 at 08:59
  • possible duplicate of [How to enable ASP classic in IIS7.5](http://stackoverflow.com/questions/9072048/how-to-enable-asp-classic-in-iis7-5) – user692942 Mar 05 '14 at 10:04
  • `<% Response.Write("Hello world") %>` should work in Classic ASP although you don't actually need the brackets. Could there be anything else on your page causing this? The error message you are getting is the standard 500 error page you get if you don't enable detailed error messages. Follow the steps on this page -http://www.chestysoft.com/asp-error-messages.asp – John Mar 05 '14 at 13:46

2 Answers2

0

You are probably missing the Handler Mappings either for your website or the server (can be configured at multiple levels. Personally I set it at the server level and let it inherit down and enable or disable as appropriate.

This answer has all the information you need to set it up - Answer - How to enable ASP classic in IIS7.5

Should also point out that although the article is talking about IIS 7.5 the procedure is exactly the same in IIS 7.

Handler Mappings are found under the IIS section in the Internet Information Manager.

Add a script map using the following setting (taken from the linked answer):

Request Path: *.asp
Executable: C:\Windows\system32\inetsrv\asp.dll
Name: whatever you want. I named my Classic ASP

The executable above is 64 BIT ASP handler for your asp script. If you want your ASP script to be handled in 32 bit environment, you need to use executable from this location: C:\Windows\SysWOW64\inetsrv\asp.dll.

Community
  • 1
  • 1
user692942
  • 16,398
  • 7
  • 76
  • 175
  • Maybe this should be mark as duplicate and pointed to http://stackoverflow.com/questions/9072048/how-to-enable-asp-classic-in-iis7-5 the more I think about it... – user692942 Mar 05 '14 at 10:03
  • I checked the Handler Mappings section of my server and it already had a mapping from `*.asp` to `%windir%\system32\inetsrv\asp.dll`, yet it still shows that same error message. – Raghav Malik Mar 05 '14 at 11:11
  • @coder108 Have you tried looking in event viewer to see if it's logged in the actual error in there? – user692942 Mar 05 '14 at 11:16
  • Where is the event viewer? – Raghav Malik Mar 05 '14 at 11:16
  • @coder108 Event Viewer can be found in your Administrative Tools which should be located in Control Panel. I just type `eventvwr` in your search bar on the start menu. – user692942 Mar 05 '14 at 11:18
  • I checked the event log but there wasn't any error logged in. – Raghav Malik Mar 05 '14 at 20:03
-1

Your pages need to have a .aspx extension and you should revise your page's markup to look something like:

<html>
<body>
<p><%Response.Write("Hello World")%></p>
</body>
</html>

You may want to try using an IDE like visual studio express to help you out. Consider working through the tutorials at www.asp.net/web-forms

Asmussen
  • 430
  • 1
  • 6
  • 22
  • 1
    Thank you but I think I mistakenly tagged it as asp.net I was actually referring to a Classic ASP page. But do you know if ASP.NET supports languages other than VBScript or C#? If so, I may consider switching to that instead. – Raghav Malik Mar 05 '14 at 03:56
  • ASP.net supports C# and VB.net. Classic ASP supports VBScript and Javascript. VB.net and VBScript share some syntax, but they're different. There are other languages which can be used with if you install them, eg Perlscript for Classic ASP, Delphi, IronPython, F# for ASP.net – John Mar 05 '14 at 14:01