ASP Objects | Reference | APCS Teacher

Server | Application | Session | Request | Response | ObjectContext
 
 
Server

Property (pg 125)
Property Description
scripttimeout Length of time a script can run before an error occurs.
Methods
Method Description
createobject Creates an instances of an object or server component.
HTMLencode Applies HTML encoding to the specified string.
mappath Converts a virtual path into a physical path. (pg 128)
URLencode * Applies URL encoding including escape characters to a string.
* NOTE:  The inverse method, URLdecode, is not supported, but may be added separately.


Application

Collections
Collections Description
Contents Contains all the items added to the Application through script commands.
StaticObjects Contains all of the objects added to the Application with the <OBJECT> tab.
Methods
Methods Description
lock Prevents other clients from modifying application properties.
unlock Allows other clients to modify application properties.
Events (pg 132)
Events Description
onstart Occurs when a page in the application is first references.
onend Occurs when the application quits, after the Session_OnEnd event.
Session
Collections
Collections Description
Contents Contains all the items added to the Application through script commands.
StaticObjects Contains all of the objects added to the Application with the <OBJECT> tab.
Methods
Method Description
abandon Destroys a Session object and releases its resources.
TIP:  Using this on every page is one way to overcome Personal Web Server's limitation of 10 simultaneous sessions.
Properties
Property Description
codepage Sets the codepage that will be used for symbol mapping.
LCID Sets the locale identifier.
sessionID Returns the session identification for this user.
timeout Sets the timeout period for a session state for this application, in minutes.
Events (pg 138)
Events Description
onstart Occurs when the server creates a new session.
onend Occurs when a session is abandoned or times out.

 
 
 
 
Request
Collections (pg 85)
Collection Description Type
ClientCertificate Client certificate values sent from the browser. Read Only
Cookies Values of cookies sent from the browser. Read Only
Form Values of form elements sent from the browser using the POST method Read Only
QueryString Values of variables on the HTTP query string (these can be values of form elements sent from the browser using the GET method, or they can be values appended manually) Read Only
ServerVariables Values of the HTTP and environment variables. Read Only
Properties
Property Description Type
TotalBytes Specifies the number of bytes the client is sending in the body of this request. Read Only
Methods
Method Description
BinaryRead Used to retrieve data sent to the server as part of the POST request
Response

Collection (pg 113)

Collection Description
cookies Values of all the cookies to send to the browser.
Each element of a cookies collection has four properties
  • expires (the date & time of expiration)
  • domain (the domain, based on the URL, of origin)
  • path (a subpath of the domain, used to organize)
  • secure (true of false)
Properties
Properties Description
buffer Indicates whether to buffer the page until complete. (pg 120)
cachecontrol Determines whether proxy servers are able to cache the output generated by ASP
charset Appends the name of the character set to the content-type header
contenttype HTTP content type (i.e. "Text/HTML") for the response
expires Length of time before a page cached on a browser expires
expiresabsolute Date and time when a page ached on a browser expires
isclientconnected Indicates whether the client has disconnected from the server (boolean)
PICS Adds the value of a PICS label to the pics-label field of the response header
status Value of the HTTP status line returned by the server
Methods
Methods Description
addHeader Adds or changes a value in the HTML header
appendtolog Adds text to the web server log entry for this request
binarywrite Sends text to the browser without character-set conversion
clear Erases any buffered HTML output
end Stops processing the page and returns the current result
flush Sends buffered output immediately
redirect Instructs the browser to connect to a different URL (pg 119)
write Writes a variable to the current page as a string

 
ObjectContext
Used only when Microsoft Transaction Server is installed.  (MTS is not installed in room 101.)
Methods
Method Description
SetComplete Declares that the script is not aware of any reason for the transaction not to complete.  If all components participating in the transaction also call SetComplete, the transaction will complete.  Overrides any previous SetAbort method that has been called in a script.
SetAbort Aborts a transaction initiated by an ASP.
Events
Events Description
ontransactioncommit Occurs after a transacted script's transction commits.
ontransactionabort Occurs if the transaction is aborted.