Student Menu. © Lesson 1. Printable layout. Links won't function in print.

Notes Section

Main Text

 

Module 1.0

 

 

 

 

 

Read VBScript 
User's Guide.

 



Reference also available entirely online.

 

Review the VBScript Language Guide and Reference.

Go to msdn.microsoft.com/scripting/vbscript/default.htm with Internet Explorer (IE) 5+. Bookmark the site, visit all its VBScript links. Review the VBScript User's Guide and the VBScript Language Reference. You should already be familiar with terminology such as data types, operators, conditional statements and procedures from prior programming experience or classes; otherwise, you may have trouble with this class.

 

Module 1.1

 

 

 Sources for PWS 4.0:

 

-Windows 98

 

-Visual Studio 6 CD.

 

-MSDN Option Pack CD.

 

-Download (overnight).

 

Download the Personal Web Server 4.0 (PWS from hereon).

 

If downloading PWS overnight (may take up to four hours), go to www.asp101.com/resources/haneng/042199.asp or http://serverwatch.internet.com/webserver-mspws.html or search www.google.com for "Personal Web Server" and follow the directions. (Note: Microsoft often changes the location of PWS. If you cannot find it with a search, please use the alternative sources on the left-side column or the links below.)

 

PWS may be used to view your ASP scripts (other options below). It is your responsibility to successfully install PWS before the first class day. If on Windows 2000, please see links below.

 

This is an alternate, unofficial source for PWS,  www.studiodeluxe.net/pws/index.htm.

As a complement to the Personal Web Server (PWS)--or an alternative--you may want to publish your projects on this unendorsed free ASP web hosting site, http://www.brinkster.com/. Search the Web for others.

Windows 2000 Users (Win2K from hereon).

PWS is a bare bones and free version of a web server like the full feature Internet Information Server (IIS). Win2K provides better solutions to PWS. These links may help:

The Personal Web Manager (PWM) and Internet Information Services (IIS) Snap-in Options
www.microsoft.com/windows2000/en/professional/iis/default.asp?url=/WINDOWS2000/
en/professional/iis/htm/core/iiabuti.htm
 


Using the IIS Snap-In
www.microsoft.com/windows2000/en/professional/iis/default.asp?url=/WINDOWS2000/

en/professional/iis/htm/core/iisnapin.htm 

Win2K users have several options:

1. Try to install PWS from its alternative sources on CD rather than using the downloadable service pack from the web site.

2. Learn to use the IIS Snap-in or PWM in Win2K. (Recommended)

3. Skip using PWS, the IIS Snap-in or PWM and simply upload your ASP pages to the free unendorsed web site mentioned above which is designed for ASP developers. (Recommended as a complement or alternative to PWS, the IIS Snap-in or PWM.)

Download the Personal Web Server 4.0 (PWS from hereon).

 

If downloading PWS overnight (may take up to four hours), go to http://www.microsoft.com/Office/ORK/024/024.htm and follow the directions. (Note: Microsoft often changes the location of PWS. If you cannot find it with a search, please use the alternative sources on the left-side column or the links below.)

 

PWS may be used to view your ASP scripts (other options below). It is your responsibility to successfully install PWS before the first class day. If on Windows 2000, please see links below.

 

This is an alternate, unofficial source for PWS,  www.download-safari.net/AllFiles/MicrosoftPersonalWebServer-30.html.

As a complement to the Personal Web Server (PWS)--or an alternative--you may want to publish your projects on this unendorsed free ASP web hosting site, http://www.brinkster.com/. Search the Web for others.

Windows 2000 Users (Win2K from hereon).

PWS is a bare bones and free version of a web server like the full feature Internet Information Server (IIS). Win2K provides better solutions to PWS. These links may help:

The Personal Web Manager (PWM) and Internet Information Services (IIS) Snap-in Options
www.microsoft.com/windows2000/en/professional/iis/default.asp?url=/WINDOWS2000/
en/professional/iis/htm/core/iiabuti.htm
 


Using the IIS Snap-In
www.microsoft.com/windows2000/en/professional/iis/default.asp?url=/WINDOWS2000/

en/professional/iis/htm/core/iisnapin.htm 

Win2K users have several options:

1. Try to install PWS from its alternative sources on CD rather than using the downloadable service pack from the web site.

2. Learn to use the IIS Snap-in or PWM in Win2K. (Recommended)

3. Skip using PWS, the IIS Snap-in or PWM and simply upload your ASP pages to the free unendorsed web site mentioned above which is designed for ASP developers. (Recommended as a complement or alternative to PWS--the IIS Snap-in or PWM.)


 

 

Module 1.2

 

Install PWS.

Please follow the directions on the download web site, the PWS installation wizard or in the course textbook.

 

 

Module 1.3

 

 

 

 

 

 

 

 

 

 


 
Course examples requiring a PWS name will be coded as localhost. You should replace your own PWS name in the code showing localhost.

 

Start Personal Web Manager.

1. Double click the PWS icon on the lower right corner of your monitor near the clock.

 

2. Notice that pressing the STOP button places a red “X” on the PWS icon and creates a START button which once pressed removes the “X”. This starts web services and makes certain pages in the wwwroot folder on your computer accessible to anyone with an Internet connection provided that you’re not behind a firewall, proxy server or other security feature.

 

3. Hyperlinked in the publishing frame is the name of your PWS. This name was created from your computer’s name. If your computer hadn’t been named, your PWS name will be http://localhost. You may change your PWS name by changing your computer’s name.

 

4. Select the Advanced icon. These advanced options are used to give directory-wide permissions for any browser to view a page. If the Allow Directory Browsing check box isn’t selected, the browser will display a directory listing denied message. We’ll work with these options later.

 

5. Selecting the Edit Properties button displays three types of permissions: Read, Execute and Script. Read permission is usually enabled to prevent a read access forbidden error message. Execute permission is typically disabled, because it allows any application in a directory including script engines to run. A directory with ASP scripts should be Script enabled, because unlike Execute you may cautiously limit the applications that run in the directory. We’ll work with these advanced options further in the first assignment.

 

 

Module 1.4

 

Create a Virtual Directory.

 

An alias for a file path on a server is termed a virtual directory, and it allows for the construction of a website independent of hard drive file structure. The advantages of a virtual directory are the separation of site layout from file path structure and the ability to shorten long URLs with the use of an alias, for example, http://acc/web/ host/class/part/one.asp may be replaced with the /part alias requiring the user to only type http://acc/part/one.aps.

 

1. Create a new folder named Part1 in the wwwroot folder created by PWS.

 

2. Start PWS > click Advanced > select  <Home>  > click Add > select the Part1 folder using Browse > type Part1 for the Alias > click OK keeping the default checkboxes (Read and Scripts should be toggled).

 

3. Open the Part1 folder in Windows Explorer > right click > New > Text Document > name it HelloEx1.asp > Yes (make certain the file has the .asp extension rather than the .txt extension). Copy and paste the following text into HelloEx1.asp:

 

<HTML><HEAD><TITLE> HelloEx1</TITLE></HEAD><BODY>

Rather than writing <% Response.Write "Hello World!" %>

<BR><BR>My first ASP page will use a VBScript function on Internet Explorer to retrieve the date and time on the server. <BR><BR>The date is <% Response.Write Date %> on the server. The time is <%= Time %> on the server.

</BODY></HTML>

 

4. Save changes > type http://localhost/Part1/HelloEx1.asp into Internet Explorer where localhost is the name of your PWS. Please refer to Module section 1.3.3.

 

5. Notice:

 

  1. PWS uses the alias /Part1 for the file path C:\Inetpub\ wwwroot\Part1\HelloEx1.asp. You cannot enter this path directly in the browser.
  2. ASP code goes inside the server script delimiters, <%     %>.
  3. The shortcut for Response.Write is =.
  4. Text like Hello World! needs to be inside quotation marks “”, but a VBScript function like Date doesn’t. Don’t worry about the rest.

 

Module 1.5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 




ASP should be considered an application; therefore, ASPs are web applications and not web pages although they may output HTML, VBScript, JavaScript and web pages.

 

What is ASP?

 

A limitation of (enter word into textbox for definition) HTML is that it’s static. Developers need to employ client-side scripting (where the client is the web browser) like JavaScript, VBScripting Edition or JScript (Microsoft’s implementation of JavaScript) to make web pages dynamic (see also, Dynamic HTML). One disadvantage to client-side scripting is that it cannot carry information from one page to another. Server-side scripting like CGI, ISAPI, IDC (2) and ASP (2) addresses this restriction. ASP, however, is an improvement over CGI, ISAPI, IDC combining their advantages without their limitations.

 

Table 1.5.1. ASP combines the database access and programming ease of IDC, the robust operating system access of ISAPI or CGI and ISAPI’s speed. Third party developers may extend ASP with custom components. ASP is easier, faster to learn and more profuse than JSP. A newer and more powerful version of ASP called ASP+ (also called ASP.Net) will be available soon.

 

 

Advantage

Disadvantage

CGI

Powerful operating system access. Capabilites built into almost every server.

Difficult to maintain and debug. Taxes server resources sacrificing performance.

ISAPI

Powerful operating system access. Fast.

Must use complex languages like C/C++. Badly written programs may crash server.

IDC

Easily access and present database data to client.

Can’t add server side logic. Database programming only.

 

Because ASP pages may contain or create HTML, VBScript or JavaScript, it becomes difficult to define. As the next module will demonstrate, ASP can be best defined by where it runs: on the server.

 

 

Module 1.6

 

How Does ASP Work?

 

(1) Visiting web pages or clicking hyperlinks produce a HyperText Transfer Protocol (HTTP, see also SOAP) request by the browser. (2) As a result, the web server (please review link carefully; alternately, see server) sends the requested web pages with ASP script to the asp.dll which executes a text file called the global.asa containing information about the ASP application. (3) Then include files which support the ASP page are tied together, and (4) the ASP script moves to the script engine which creates any objects that may have been requested. (5) Next, the script engine interprets the script and send its instructions back to the asp.dll which (6) converts the information into HTML and sends it back to the browser.

 

Please refer to the index or the table of contents in the course textbook for more descriptions and diagrams on this topic.

 

 

Module 1.7

 

What Are Some ASP Web Servers and Editors?

 

If you do not have Microsoft’s Internet Information Server (IIS) which supports ASP, you may install ChiliASP or iASP which allows you to run ASP on Netscape or Unix web servers.

 

ASP and HTML may be edited in any text editor like NotePad (Start > Programs > Accessories > NotePad). Visual Interdev contains a set of convenient tools and utilites and is Microsoft’s preferred ASP editor. Others include FrontPage, Allaire’s Homesite, Macromedia’s UltraDev and the free (send a postcard) Edit Pad which is downloadable from www.tucows.com. (Do a Quick Search for the words Edit Pad.)

 

 

Module 1.8

Try out
http://validator.w3.org/

 


Bookmark this guide
http://werbach.com/barebones
/barebones.html

 


Define technical terms at

www.zdwebopedia.com

www.techweb.com/

encloypedia

 

Exercise 1.

1.    Visit all the links shown on this lesson, and thoroughly review the VBScript Language Reference (VBSLR).

2.      Read the first two chapters of the course textbook.

3.      Take notes on this week’s materials and paraphrase it in your own words. Discuss the correct answers to this week’s quiz (shown below) on the Week 1 Student Discussion Board.

4.      Review your HTML by visiting all the links on this page.

5.      Alternate between Response.Write and its shortcut to create a table with four cells. Please refer to Module section 1.4.5.3. Save this as TableEx1.asp in your Part1 folder. (There are many ways to do this assignment, and what's important is that you populate or create a table using ASP.)

6.      Use VBSLR to learn more about VBScript functions like those used in the HelloEx1.asp exercise. See Module 1.0. Review the IsDate, IsNull, IsNumeric, MsgBox, Trim and UCase fuctions.

 

 

Module 1.9

 

Quiz 1.

 

  1. Which of the following shows the correct sequence for the evolution of HTML?
  2. Why is VBSLR a valuable resource for ASP developers?
  3. Of all the server-side scripting technologies like CGI, ISAPI, IDC, JSP, ASP and ASP+ (also known as ASP.Net) which is the newest?
  4. ASP runs on the server, but where in the server is the ASP script interpreted?
  5. What button value will display a “Critical Message” icon for the MsgBox function?