411 REFERENCE · Wikibooks
Active Server Pages/Your first page
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Active Server Pages Differences between ASP 3.0 and ASP.NET Basic ASP Syntax
Objectives
Embed ASP scripting code into a web page.
Upload your ASP page to a server.
Test your page by viewing it in a web browser.
Content
ASP is delimited with "<%" and "%>"
within these delimiters is your custom code that is executed in the server.
Here is a small fragment of an ASP code (it outputs "My First ASP" on your browser):
<%
Response.Write "My First ASP"
%>
Or you could put the text into a pre-defined variable:
<%
Dim MyText
MyText = "My First ASP Page"
Response.Write MyText
%>
Here is a way to separate your code from your page layout.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim MyText
MyText = "My First ASP"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>My First ASP</title>
</head>
<body>
<%=(MyText)%>
</body>
</html>
Summary
Review Questions
Exercises
Active Server Pages Differences between ASP 3.0 and ASP.NET Basic ASP Syntax