Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp/VBScript in IIS 2

Status
Not open for further replies.

gwillr

IS-IT--Management
Nov 4, 2003
267
0
0
CA
I am running IIS 5.1 and have been learning some ASP. I have written a small code as a "test" page as follows:

<HTML>
<HEAD>
<TITLE>Hello, World !</TITLE>
</HEAD>
<BODY>
<%= &quot;Hello, World!&quot; %>
</BODY>
</HTML>

When I try save this as blah.asp, and try to access it, i get the folloing error messasge in browser:

The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

Technical Information (for support personnel)

* Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/web/~/test/asp/index.asp, line 7


normal html pages display just fine, even with the .asp extension.

how can I fix this??

Gary
 
If you just want to test that the ASP is being served...
change <%=&quot;hello world%> line too..

<%
response.write(&quot;If I can see this then ASP works&quot;)
%>

That will do it...

;-)

Jim
 
yeha Jim, i have tried that format as well, but it will not display. I think it may be a server setting that is causing the error.

any suggestions would be greatly appreciated!

Gary
 
Hm...
For the IIS server to work, you must identify what folder it works &quot;on&quot;...ussually C:/inetput/
If the file above is in that folder AND IIS is running (do a console check to confirm that) then you should be able to see that asp page...ie it will 'work!'

Do you use an editor to craft same? I use EditPlus and I had to tell it what folder to use as well so that it can both find the page AND get IIS to serve same..

:)

Jim
 
Well it's not your code. I didn't think anything was wrong with it but I copied/pasted it and it runs fine on my server.
I've never had to put my ASP files in a certain directory before, just a directory that was web accessible, so I don't think this is the issue.
Can you check to see if you have the .asp extension mapped to c:\winnt\system32\asp.dll?
Try sticking the following line at the top of your asp file:
<%@ Language=&quot;VBScript&quot; %> thus forcing it to use VBScript. I'm pretty sure this won't have an affect on it but lets try it to be safe.

Scott Heath
AIM: orange7288
 
well skotman, my .asp extension is mapped to
C:\WINDOWS\system32\inetsrv\asp.dll

adding that line of code didnt help., however, im now getting a page display, but its all skewed: here it is::

CODE IS:

<HTML>
<HEAD>
<%@ Language=&quot;VBScript&quot; %>
<TITLE>Hello, World !</TITLE>
</HEAD>
<BODY>
<% Response.Write(&quot;Hello World&quot;) %>
</BODY>
</HTML>

THE OUTPUT IN BROWSER IS:

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} \viewkind4\uc1\pard\f0\fs20 \par \par \par \par \par Hello World\par \par \par }

This baffles be, as i have checked the code many times. Any suggestions will be great!

Gary
 
For IIS to be able to &quot;serve&quot; ASP pages on your own workstation, it must be told which folder to treat as it's home directory.

Go to the console, hilite the Default Web Site under the IIS Services, click on the Home Directory tab, and make sure that you are using C:inetput/ under your local path and then check off at least the read, write boxes so that you can write to dbases etc.

Without doing that, IIS is &quot;lost&quot; and while it wants to serve the ASP pages you run, it can't..

;-)

Jim
 
Thank you all for your help. The problem is now solved. It was a combination of code errors, and IIS settings.

had the code been correct, all that was needed was adding &quot;index.asp&quot;, and &quot;default.asp&quot; to the default pages list. also, checking the &quot;write&quot; and &quot;run scripts&quot; box for folder permissions was necessary.

having done all this still didnt allow it to work.

the key here was RESTARTING IIS. This had to be done i guess, for the changes to occour. also, when editing the asp code with FrontPage, you must &quot;SaveAS&quot; not just &quot;Save&quot; for the changes to save and be run correctly for some reason.

Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top