Getting started with asp-classic

Download asp-classic eBook

Remarks

Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was Microsoft's first server-side script-engine for dynamically-generated web pages. The introduction of ASP.NET led to use of the term Classic ASP for the original technology.

The default server-side scripting language for ASP is VBScript. The generated pages are meant to be viewed in a browser, so they usually use HTML markup and CSS styling.

1 ASP is not installed by default on these versions of IIS. You need to go into the server manager features and add ASP.
See Classic ASP Not Installed by Default on IIS 7.0 and above

Versions

IISASPReleased
3.01.01996-12-01
4.02.01997-09-01
5.03.02000-11-01
6.03.02003-01-01
7.03.012008-01-01
7.53.012009-01-01
8.03.012012-01-01

Hello World

<!doctype html>
<html>
  <head>
    <title>Example Page</title>
  </head>
  <body>
<%
  'This is where the ASP code begins
  'ASP will generate the HTML that is passed to the browser
  'A single quote denotes a comment, so these lines are not executed
  'Since this will be HTML, we included the html and body tags
  'for Classic ASP we use Response.Write() to output our text
  'like this
  
  Response.Write ("Hello world")
  
  'Now we will end the ASP block and close our body and html tags
%>
  </body>
</html>
 

When response is sent from the Server to the Browser the output will be like this:

<!doctype html>
<html>
  <head>
    <title>Example Page</title>
  </head>
  <body>
 Hello world
  </body>
</html>
 

Structure of a Simple ASP Page

<%@ Language="VBScript" CodePage = 65001 %>
<%
Option Explicit
Response.Charset = "UTF-8"
Response.CodePage = 65001
%>
<!doctype html>
<html>
  <head>
    <title>My First Classic ASP Page</title>
  </head>

  <body>
    <%="Hello World"%>
  </body>
</html>
 

This is a very basic example of a Classic ASP page that returns the phrase "Hello World" to the browser along with the rest of the standard HTML. The HTML portions are static, i.e. the server will send them to the browser as-is. The parts delimited by <% %> are what the server will actually process before sending it to the client.

Note that the <%="stuff"%> syntax is shorthand for <%Response.Write "stuff"%> .

Stats

143 Contributors: 6
Wednesday, January 4, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook