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

 

Notes Section

Main Text


Module 2.0

Seven Built-in ASP Objects Synopsis
.
(Quick Review from ASP 1.)

There are seven built-in ASP objects. Only two to four of them are ever used frequently.

1. Server Object: Represents some properties and methods of the web server.

2. Application Object: Allows web pages within a site to act as a single ASP application.

3. Session Object: Uniquely represents each visitor accessing the ASP application.

4. Request Object: Used by the visitor to request information from the web server.

5. Response Object: Used by the web server to send output in response to the visitor's information request.

6. ObjectContext Object: An advanced tool used with Microsoft Transaction Server (MTS) to build scalable applications from components.

7. ASPError Object: Holds ASP script and asp.dll error messages.


Module 2.1













The primary difference between the QueryString Collection and the Form Collection is that QueryString gets appended to the URL with a question mark via the Get Method while Form gets sent within the HTTP request via the Post Method.


Request Object.

Used by the client (visitor) to request information from the web server. It encapsulates client-requested information as a package for use by the server.

The Request Object has five collections (or parts):

1. QueryString - Sends values submitted from an HTML form within the URL. Can be generated in four ways: (1) Anchor tag, (2) Get Method, (3) HTTP address and (4) Response.Redirect Method

2. Form - Sends values submitted from an HTML form within the HTTP request body via the Post Method.

3. ServerVariables - Holds HTTP headers that contain information such as browser type or referring page name as well as information about the server. See project1a for practice using the ServerVariables.

4. Cookies - Identify and mark a client entering a web site by storing information on the client's computer that is used by a particular server to (1) personalize web pages, (2) determine where the client has been and (3) keep clients updated on information.

5. ClientCertificate - This collection stores digital certificates exchanged between the visiting client and the server.

Please read, outline and paraphrase Chapter Seven and review Appendix A in the course textbook. Work the Try It Out project for the Request Object with your own code if possible.


Module 2.2












*ASP processing is held within the HTML Output Stream that is sent to the client when complete.

Response Object
.

Used by the web server to send output in response to the client's (visitor) information request.

Some notable methods and properties are:

1. Write Method - Two techniques for sending information back to the client: (1) Response.Write and (2) the shortcut, <%=    %>.

2. Buffer Property - Allows for manual control of the HTML Output Stream*. Its Flush Method immediately sends everything within the buffer to the client. Its Clear Method erases HTML already within the buffer except response headers. Its End Method stops the server from processing the ASP script and sends the remaining buffer output to the client.

3. Expires and ExpiresAbsolute Properties - Expires specifies in minutes how long a web page should be cached. ExpiresAbsolute works like Expires but is for periods longer than minutes, and it sets the date and/or time a cached web page expires.

4. Redirect Method - Informs the browser to retrieve a different web page within the same web site or on a completely different web site.

Please read, outline and paraphrase Chapter Seven and review Appendix A in the course textbook. Work the Try It Out project for the Response Object with your own code if possible.

 

Module 2.3

 

Exercise 2.

 
  1. Define any new vocabulary terms using the course textbook, the VBSLR or the online resources mentioned in Lesson 1, Module 1.8.
  2. Please read, outline and paraphrase Chapter Seven and review Appendix A in the course textbook.
  3. Do all of the Try It Out exercises in Chapter Seven. You may be able to download the code from the book's publisher, Wrox, but it's better if you try writing your own based on what's shown in the course textbook.
  4. Take notes on this week’s materials including the Try It Out exercises and paraphrase them in your own words
  5. Don't forget to take the quiz, and collaborate with your online colleagues on this week's discussion board.

 

 

Module 2.4

 

Quiz 2.

Hint: All the answers are found on this page, but please still read Chapter Seven.

 

  1. Which of the following objects may generate the QueryString Collection?
  2. What is the main difference between the QueryString Collection and the Form Collection?
  3. In ASP, cookies are used to?
  4. What does the HTML Output Stream hold?
  5. Redirect is a method of which object?