J2EEOnline J2EEOnline


ASP   «Prev  Next»
Lesson 10The ASP object model
ObjectiveUse ASP's objects to simplify writing ASP operations.

ASP Object Model

The interaction between Web clients and servers is complex, with many messages passed between the two. However, most of the time we only need to work with one part of this complex interaction, for example a cookie sent by a user's browser to our Web server.
One of the goals of ASP, and object-oriented programming in general, is to hide unneeded complexity from the developer.

The designers of ASP have built a model of this complex interaction in the ASP object model. As we work with ASP, we will do so through the five "built-in" objects of ASP:
  1. Application,
  2. Request,
  3. Response,
  4. Server, and
  5. Session.

This SlideShow below describes the five objects of the ASP object model that represent the categories of operations during a browser-server dialog:

ASP.NET Core 3
  1. The request object, this is used to receive data from the client's browser and computer, including cookies, files, and HTML forms.
  2. Response object is used to send data or HTML code from directories or memory locations on the server back to the client browser and computer
  3. The session object is used to store data and create a work area for each user who visits and navigates around the web site.
  4. Application object is used to allow more than one user at a time to run a web application, which can be a separate program linked to the Web pages or the Web pages
  5. The server object, this is used to contain and send information about the web server itself, perform cleanup of user information no longer needed

Five ASP Objects
Each of the five objects is an object in the object-oriented programming sense and can have its own properties and methods.
In later modules, we will cover each of the objects in detail. Compare scripting alternatives for embedding programs in HTML.