Creating Active Server Pages
Introduction.
Remember, ASP pages are composed of programmatic code and embedded
HTML. There really is nothing mysterious about them. Well,
nothing mysterious to relatively experienced software developers. They
are text files and can be created in Notepad, FrontPage or InterDev. When the ASP page is
requested by a user it's programmatic code is executed by the host/remote
server and then downloaded to the user as HTML code. The programmatic code is delimited differently from
typical HTML.
ASP is a server technology not a computer language. VBScript, JavaScript, PerlScript and Python are four of the most typical scripting languages used to create the programmatic code in ASPs. While there are several ways to implement ASPs, we will start with the following. Lines that are included between an <% and a %> are treated as script that should be compiled and executed by the host server. The results of this are then placed into HTML so that user can see or interact with the resulting page. The scripting language that should be used is determined by the very first line in the file. <%@ Language=VBScript %> signals the server to start looking for VBScript source code. As with any topic, there are a huge variety of things we could cover. If you want a good reference that goes into more depth on ASPs you should consider the Mitchell and Atkinson book listed on the course page. In this course, we are going to spend about four weeks focusing on ASPs in order to get you up to a level where you can develop e-commerce webs as done in Jerke. Your First ASP. Well, this is your first ASP in this course anyway. I am about to develop a relatively straightforward ASP which you should copy. We will then dissect it during class. The ASP will find the cube of the first ten digits. As advertised, it is a mixture of VBScript and HTML. At this point you should just copy the code into some sort of text editor and save it as Cubes.asp in some sub-directory of the course directory you have created on your computer. |
<%@ Language=VBScript %> <% Option Explicit %> <html> <head> <title>Calculating Cubes</title> </head> <body> <B>Cubes</B><BR> <% Dim iLoop For iLoop = 1 to 10
Next |
The code should be another indication that you have not wasted your time learning VB in the past.
Now you should FTP/publish this code to your root web for this course. This will be a first test of whether your permissions are set up correctly. After this you need to open your web browser of choice and go to the following URL. http://faculty.quinnipiac.edu/YourRootWeb/Cubes.asp at which point you should see the following image. |
Notice the Calculating Cubes title for the browser and
the Cubes title on the page.
This exercise should also server the purpose of making sure that your accounts, computers and software are working at least to this level. The Process for ASP Enactment. The following diagram represents the major steps in enacting and ASP. |
The major steps involved are
It is important to remember that this ASP enactment process is completed when the page is sent back to the user. Other enactments may be requested, but this is the nature of server-side processing. |