LESSON 1
Overview
Active Server Pages (ASP) is a technology to develop dynamic web pages. I call it a "technology" because it really is a combination of a couple things. First it is a scripting engine which runs on a web server, second it is a set of commands that do different things and third it is a scripting language.
For this class you will get a basic understanding of how to create dynamic web pages using the Microsoft technology ASP, learn how to create basic program scripts and learn how web pages can make web site a lot more interesting.
Before I get into anything technical at all, let's discuss what a dynamic web page is and how it differs from a regular static one.
Note: There are many different types of technologies that create dynamic web pages (PHP, ASP.NET, JSP, Coldfusion, etc.), but no matter what you use they all do the same thing when it comes to making your website(s) more robust in giving your web site users a more enjoyable web experience.
If you surf around the internet today, you'll see that there are lots of static web pages out there. What do I mean by a static web page? Essentially, it is a page whose content consists of some HTML that was typed directly in a text or web editor and saved as an .html or .htm file. The author of the page has already completely determined the exact content of the page, in HTML, at some time before any user visits the page.
Note: I will not discuss how JavaScript can make your page "dynamic" since the content still has to be written on the page first.
Static Pages vs. Dynamic Pages
Static Web Pages
Here are the basic steps at how a static web page finds its way into a client (user) web browser:
- Author writes a page composed of HTML and saves it with and .html or .htm extension and then uploads the web page to a web server somewhere on the internet.
- A user requests the page by typing the address in their web browser and the request is passed from the browser through the internet to the web server.
- The web server locates the .html or .htm page.
- The web server sends a HTML data stream (bits and bytes) back across the internet to the web browser.
- The web browser parses (reads and interprets) the HTML and displays the page.
Limitations of Static Web Pages
Basically, everything on each web page you create will have to be "hand-coded" by you and will look the same for every user no matter where they are or what they want to see from your web page. If for example, you wanted to show people new information based upon what time of day it was or wanted you be able to have people send you information in a form or have your page link to a list of products you want to sell you basically are out of luck. Static web pages are great for web sites that will never change during the lifetime they are online or if you do not mind constantly updating your site by editing you web page(s) and uploading them back on the internet. But there has to be a better way, right?
Note: The term web server refers to the software that manages the web pages and makes them available to the 'client' computers - via a local network or via the internet. In the case of the internet, the web server and browser are usually on two different machines many, many miles apart. I will briefly review how to setup a local web server on your own PC, but for this class I will show you exactly how to use a free web host where you will post all your assignments and you work files as you learn.
Dynamic Web Pages
We need a way to replace some of that "hard-coded" HTML source with a set of instructions, which will be used to generate HTML for the page at the time the user requests the page. In other words the page is generated dynamically on request.
Here are the basic steps at how a dynamic web page finds its way into a web browser:
- Author writes a page composed of HTML and saves it (not .html or .htm) and then uploads the web page to a web server somewhere on the internet.
- A user requests the page by typing the address in their web browser and the request is passed from the browser to the web server.
- The web server locates the file of instructions.
- The web server follows the instructions in order to create a data stream of HTML
- The web server sends the newly created HTML stream back across the network to the web browser.
- The web browser processes the HTML and displays the page.
The process of serving a dynamic web page is only slightly different (steps 3 and 4) from the process of serving a static web page. There is just one extra step involved (step 4). But the difference is crucial -- the HTML that defines the web page is not generated until after the web page has been requested. For example, we can use this technique to write a set of instructions for creating a page that displays the current time:
Continued...