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
IIS | ASP | Released |
---|---|---|
3.0 | 1.0 | 1996-12-01 |
4.0 | 2.0 | 1997-09-01 |
5.0 | 3.0 | 2000-11-01 |
6.0 | 3.0 | 2003-01-01 |
7.0 | 3.01 | 2008-01-01 |
7.5 | 3.01 | 2009-01-01 |
8.0 | 3.01 | 2012-01-01 |
<!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>
<%@ 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"%>
.