Skip Navigation Links.
Getting Started with ASP
Language(s):ASP
Category(s):Into

This article describes how to get started with writing ASP programs. All you need is Personal Web Server and you're ready to go.

Getting Started with ASP 

Jon Vote, Idioma Software Inc. 

03/2002 

www.idioma-software.com 

ASP, which stands for Active Server Pages, is a Microsoft Scripting language based on Visual Basic. If you know Visual Basic and HTML, you are already an ASP programmer whether you know it or not! 

ASP is proprietory to Microsoft and works best on Microsoft servers. Although there are supposedly versions for other operating systmems I personally am not experienced with ASP on anything other than a Microsoft Server. (If you have any information about running ASP in Linux or other types of servers, I'd love to hear from you! Submit an article about it!) Unless other wise indicated, you should assume that the ASP examples on this site will only run on a Microsoft server. 

You can run ASP code on your own machine by installing Personal Web Server, which is free from Microsoft. For Windows 95 and NT 4.0 users it is available from Microsoft as the Windows NT Option Package. See www.microsoft.com for further information. Windows 98 comes with Personal Web Server on the setup CDROM. 

The first gotcha that you are likely to encounter is trying to run your first ASP program. It does not work to just double-click an ASP in Windows Explorer like it does with an HTML file. Before an ASP page can be run, it must first be located within the wwwroot subdirectory of the intepub directory (these directories will be created by the Personal Web Server setup). Assuming you have located your ASP program in the appropriate subdirectory, you may now access it in the browser. Instead of entering the Windows path name of the ASP program in the browser, you connect to the Personal Web Server in the following manner: 

  localhost/folder/file.asp

Where folder is a folder in the inetpub folder. For example, suppose you want to run: 

  c:\inetpub\wwwroot\coolstuff\cool.asp 

You would enter this in the browser as 

  localhost/coolstuff/cool.asp

Follow these instructions to write your first ASP program: 

1) Install Personal Web Server. See Microsoft's page for more information. 

2) Create a folder in wwwroot called coolstuff. Example: 
     c:\inetpub\wwwroot\coolstuff

3) Copy the code listed below and paste it into Notepad. Save the file as cool.asp in the coolstuff folder. 
  
4) Run your browser and navgate to 
  localhost/coolstuff/cool.asp

<!-- Copy this code starting here -->  

<!-- 
  Getting started with ASP 
  
  Jon Vote, Idioma Software Inc. 

  03/2002 

  www.idioma-software.com 
--> 

<!-- 
  The ASP code appears between the <% %>
  Everything else is just sent as plain ol' HTML
-->

<% @Language=VBScript %>
<% Option Explicit    %> 

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Getting Started in ASP - your first ASP program.</TITLE>
</HEAD>
<BODY>

<Center>
 <H3>This code example is brought to you by
  <A Href=http://www.idioma-software.com>Idioma Software Inc.</A></H3><BR>
</H3>
</Center>

<Center>
<H4>
<% 'Here is some asp

 Dim i 

 For i = 1 to 10 
   Response.Write "It is " & Date() & " do you know where your code is?"
 Next 

%>

</H4>
</Center>

<Center>
\|/|\|/|\<BR>
|(.) (.)|<BR>
<   |   ><BR>
  ----- <BR>
| Hello |<BR>
[_WORLD_]<BR>
:::::::::<BR>
</Center><BR>

</BODY>
</HTML>


This article has been viewed 5390 times.
The examples on this page are presented "as is". They may be used in code as long as credit is given to the original author. Contents of this page may not be reproduced or published in any other manner what so ever without written permission from Idioma Software Inc.