|
How Files Are Interpreted
Normally, HTML files are "interpreted" on the client side (in a user's web
browser). With Microsoft's Active Platform, the server can also interpret
files. Interpreting to a server means that before displaying a file in a
user's browser, the server will complete some initial steps:
- It will look at the file's extension. If the file has a standard
extension, such as .html or .htm, the server will pass the file to the
browser. If the file has an extension of .asp (or .asa), the server will
open the file and look for tags that mark ASP code. ASP code is contained
inside special tags: <% before the code begins and %> after it ends.
- The server evaluates the code contained inside these tags and
replaces it with HTML code. This HTML code is generated based on
information about the user's setup or other conditions on the client side.
- The resulting page, which contains some of the file's original markup
and some markup that has been generated with ASP, is sent to the browser
that requested it.
Let's take the example of a shopping cart. Imagine a customer has selected five items from the store's catalog. These selections are listed together on one "shopping cart" page, which contains a table with rows and columns. At the top of each column is a heading, such as quantity, description, stock number, or price. How will you construct this page, considering that parts of it are dependent on what the customer has chosen?
The column headings can be included in the original HTML layout, since they won't change. The table's position probably won't change either, so it can also be incorporated into the original HTML file. These elements of the page will remain the same, regardless of how many times you come back and view the page.
The information inside the table (the list of what has been selected for purchase) will change, however. Each person viewing the site may select a different set of items. To display this information, ASP pulls the item information from a database and adds that item information to the HTML layout before it is sent back to the user's browser. Programmers use the term "on the fly" for this type of page, because it doesn't exist on its own. Instead, it is created on demand ("on the fly") when needed. The ASP script creates the entire page, by combining the static page elements with selected information from the database.
You can view a diagram showing how this works.
|
Roadmap
Microsoft's official ASP documentation.
ActiveServer Pages.com
Self-described "best ASP resource in the world." Check out their ASP Quick Lessons.
15 Seconds
Top ASP resource featuring articles, news, and much more.
The ASP Hole
A guide to ASP and IIS resources.
Site Builder Network: Server: ASP
Articles and white papers on ASP from Microsoft's Site Builder Network.

|