I just got ASP support enabled with my host and I'm trying to write my first active server page with a simple 'Hello World' test:

<!-- Test.asp -->

<html>
<body>
<% puts "Hello World!" %>
</body>
</html>

but instead of getting this output in the browser:

Hello World!

I get this:

<!-- Test.asp -->

<html>
<body>
<% puts "Hello World!" %>
</body>
</html>

Am I missing something? Is there setup that I have to do with my host prior to being able to use ASPs?

*Update*

Turns out they hadn't switched me to a ASP server yet. Now that I'm on one, I tried creating a test page, test.asp:

<!-- test.asp -->

<%
#!/usr/bin/ruby
puts "Hello World!"
%>

but get this internal server error:

Error Type:
Sun ONE ASP VBScript compilation (0x800A0438)
Unexpected end of line inside a string
/~dchang/test.asp, line 4, column 18

I tried taking out the shebang

<!-- test.asp -->

<%
puts "Hello World!"
%>

but then get this error:

Error Type:
Sun ONE ASP VBScript runtime (0x800A01F4)
'puts' is undefined
/~dchang/test.asp, line 4

What am I doing wrong here?

In ASP, you would send output to browser this way:

<%
response.write("Hello World!")
%>

I suggest a quick run-through ASP tutorial at
http://www.w3schools.com/asp/

or, if you wish to elminite response.write, put <%= "Hello World" %>

<%= is short for response.write.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.