ASP Lecture Series (10) ASP Built-in Objects
Author:Eve Cole
Update Time:2009-05-30 19:59:05
Active Server Pages provides built-in objects that make it easier for users to collect information sent through browser requests, respond to the browser, and store user information such as user preferences. This article briefly describes each object.
Application Object You can use the Application object to share information with all users of a given application.
Request object You can use the Request object to access any information passed with the HTTP request, including parameters, cookies, and user authentication passed from the HTML form with the POST method or the GET method. The Request object enables you to access binary data sent to the server, such as an uploaded file.
Response Object You can use the Response object to control the information sent to the user. This includes sending information directly to the browser, redirecting the browser to another URL, or setting the value of a cookie.
Server object
The Server object provides access to methods and properties on the server. The most common method is to create an instance of an ActiveX component (Server.CreateObject). Other methods are used to encode URLs or HTML into strings, map virtual paths to physical paths, and set timeout periods for scripts.
Session Object You can use the Session object to store information required for a specific user session. The variables stored in the Session object are not cleared when the user jumps between pages in the application; these variables always exist when the user accesses pages in the application. You can also use the Session method to explicitly end a session and set the timeout period for idle sessions.
ObjectContext object You can use the ObjectContext object to commit or undo transactions initiated by ASP scripts.