Creating Webpages With ASP
In the early days of the web, creating a webpage was pretty straight forward.
You formated the webpage using HTML (HyperText Markup Language). Every time
you accessed the webpage, it looked exactly the same. Webpages were "static".
CGI (Common Gateway Interface) scripts were used to pass data from web forms
to the web server. CGI scripts were usually written in Perl. Perl is a language
that is about as easy to understand as differential calculus.
Later advances brought Java Script, DHTML (Dynamic HTML) and CSS (Cascading Style
Sheets). This allowed webmasters to create some pretty amazing applications. With
these new technologies web pages became "dynamic". But these are all client side
technologies. The applications could use only data that was on the webpage or
was entered the web browser by the user.
ASP (Active Server Pages) is a server side technology that allows you to share
data between the web server and the user, and to create dynamic webpages without
worrying about the capabilities of the user's browser. With ASP, technically
you don't need any "webpages" on your server. You need only data and the ASP
code to build webpages on the fly.
Today ASP competes with PHP (Personal Home Page), an open source scripting language
that looks a lot like Perl. ASP can be written in Java Script, but is usually written
in VBScript (Visual Basic Script). "Visual" refers to Microsoft's visual development
environment where you create applications by dragging and dropping visual elements
into place. Basic is a very easy to learn programming language.
In the early days of computers, programming languages where compiled. The programmer's
source code was run through an application that converted it to machine instructions.
Then the compiled executable program could be run on the computer. Today compiled
programs are used when the code must be fast and efficient. But most modern programming
lanugages are scripting languages.
With a scripting language, the programmer's source code is passed to an interpreter
program that does the compiling on the fly. Today's computers are so powerful that
scripting languages are fast enough for most purposes. VBScript is a powerful and
easy to understand scripting language.
ASP webpages have the file extension .asp. You can change the file
extension of an html webpage from .htm to .asp, and run it on an ASP
server. ASP will scan through the text on the page looking for the characters <%
and %>. ASP executes any instructions it finds between the <% tag and the %>
tag. These tags are referred to as the ASP delimiter tags.
To create a simple ASP page, type the following text into Windows Notepad and save
the file with the extension .asp.
<% Response.Write "This is my first ASP page" %>
The above code uses the Write method of ASPs built-in Response object
to write to the client's browser.