Elements of an Active Server Page

The Adventure Works Web Site

When you install ASP on your server, the sample Adventure Works Web site is included.

In this exercise, you connect to the Adventure Works ASP Web site and review the code that controls the Web application. The details of how this code works will be discussed through the remainder of this chapter.

* To connect to the Adventure Works Web site

  1. If it is not already running, start the Microsoft Personal Web Server from the Control Panel.
  2. Open Internet Explorer and browse to the following address:

    http://localhost/advworks

  3. To review the ASP code that builds this page, click the View ASP Source button located in the left-hand margin.

    Locate the following code:

     <% If IsEmpty(Session("CustomerFirstName")) Then %>  Welcome!!! <% Else %>  Welcome back <%=Session("CustomerFirstName")%>!!! <% End If %> </B> You are visitor #<B><%=FormatNumber(Session("VisitorID"),0)%></B> 

    You have not logged into this Web site before, so you have been presented with only the number of visitors to date.

* To enter a sample order and update the ASP site with your personal information:
  1. Click the browser's Back button to return to the Adventure Web site.
  2. Click the Geared Up button, and then select Parkas .
  3. Click on a Parka to purchase it, and then click the Click to Pay button.
  4. Enter your customer information (for this exercise you can make this up) and click Enter Customer Info .
  5. Review your sample order and enter a credit card number of 1111 2222 with an expiration date of your choice.
  6. Click Order Now! when you are done.
  7. Click the Home button to return to the home page.

    ASP has remembered who you are and uses your first name to welcome you back.

  8. Explore the Adventure Works Web site and click View ASP Source at any time to see how the Web site has been built.

Lesson Summary

Server-side scripts provide functionality to Web pages on client browsers, but run on Web servers. Pages that include server-side script are called Active Server Pages. An ASP file is a text file that contains any combination of text HTML tags, server-side script, and client-side script. ASP automatically supports both VBScript and JavaScript; however, any script language can be used as long as there is a corresponding script engine to interpret the script.


Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net