Qindex Programming Tips
101 [Quick Reference] Built-in ASP Objects
written by Qindex at 2007-12-25 00:13 /

Application
ASPError
ObjectContext
Request
Response
Server
Session

Application Use the Application object to share information among all users of a given application.
    collections
    Contents contains all of the items that have been added to the application through script commands.
    StaticObjects contains all of the objects created with the <OBJECT> tags within the scope of the Application object.
    methods
    Contents.Remove deletes an item from the Application object's Contents collection.
    Contents.RemoveAll deletes all items from the Application object's Contents collection.
    Lock prevents other clients from modifying Application object properties.
    Unlock allows other clients to modify Application object properties.
    events
    Application_OnEnd occurs when the application quits, after the Session_OnEnd event.
    Application_OnStart occurs before the first new session is created, that is, before the Session_OnStart event.


ASPError used to obtain information about an error condition that has occurred in script in an ASP page.
    properties
    ASPCode Returns an error code generated by IIS Number Returns the standard COM error code
    Source Returns the actual source code, when available, of the line that caused the error
    Category Indicates if the source of the error was internal to ASP, the scripting language, or an object
    File Indicates the name of the .asp file that was being processed when the error occurred
    Line Indicates the line within the .asp file that generated the error
    Column Indicates the column position within the .asp file that generated the error
    Description Returns a short description of the error
    ASPDescription Returns a more detailed description of the error if it is an ASP-related error


ObjectContext Used to either commit or abort a transaction, managed by Component Services, that has been initiated by a script contained in an ASP page.
    methods
    SetAbort declares that the transaction initiated by the script has not completed and the resources should not be updated.
    SetComplete declares that the script is not aware of any reason for the transaction not to complete.
    events
    OnTransactionAbort occurs if the transaction is aborted.
    OnTransactionCommit occurs after a transactional script's transaction commits.


Request retrieves the values that the client browser passed to the server during an HTTP request.

http://msdn2.microsoft.com/en-us/library/ms524948.aspx
    collections
    ClientCertificate The values of fields stored in the client certificate that is sent in the HTTP request.
    Cookies The values of cookies sent in the HTTP request.
    Form The values of form elements in the HTTP request body.
    QueryString The values of variables in the HTTP query string.
    ServerVariables The values of predetermined environment variables.
    methods
    TotalBytes Read-only; specifies the total number of bytes the client is sending in the body of the request.
    events
    BinaryRead Retrieves data sent to the server from the client as part of a POST request.

 

 


Response used to send output to the client.

http://msdn2.microsoft.com/en-us/library/ms525405.aspx
    collections
    Cookies Specifies cookie values. Using this collection, you can set cookie values.
    properties
    Buffer Indicates whether page output is buffered.
    CacheControl Sets a header to tell proxy servers or other cache mechanisms whether they can cache the output generated by ASP.
    Charset Appends the name of the character set to the content-type header. The character set tells the browser how to display characters.
    CodePage Sets the Codepage for data in the intrinsic objects for one response. The codepage tells the server how to encode characters for different languages.
    ContentType Specifies the HTTP content type for the response.
    Expires Specifies the length of time before a page cached on a browser expires.
    ExpiresAbsolute Specifies the date and time on which a page cached on a browser expires.
    IsClientConnected Indicates whether the client has disconnected from the server.
    LCID Sets the LCID for data for one response. The LCID refers to how dates, times, and currency are formatted for a specific geographical locale.
    Pics Set the value for the pics-label response header, to indicate the PICS content rating.
    Status The value of the status line returned by the server.
    methods
    AddHeader Sets the HTML header name to value.
    AppendToLog Adds a string to the end of the Web server log entry for this request.
    BinaryWrite Writes the given information to the current HTTP output without any character-set conversion.
    Clear Erases any buffered HTML output.
    End Stops processing the .asp file and returns the current result.
    Flush Sends buffered output immediately.
    Redirect Sends a redirect message to the browser, causing it to attempt to connect to a different URL.
    Write Writes a variable or text to the current HTTP output as a string.

 

 


Server provides access to methods and properties on the server.

http://msdn2.microsoft.com/en-us/library/ms525541.aspx
    properties
    ScriptTimeout The amount of time that a script can run before it times out.
    methods
    CreateObject Creates an instance of a server component.
    Execute Executes an .asp file.
    GetLastError Returns an ASPError object that describes the error condition.
    HTMLEncode Applies HTML encoding to the specified string.
    MapPath Maps the specified virtual path, either the absolute path on the current server or the path relative to the current page, into a physical path.
    Transfer Sends all of the current state information to another .asp file for processing.
    URLEncode Applies URL encoding rules, including escape characters, to the string.

 


Session Calls the methods and properties of the Session object.
    collections
    Contents contains all of the items that have been established for a session without using the <OBJECT> tag.
    StaticObjects contains all of the objects created with the <OBJECT> tag within the scope of the session object.
    properties
    CodePage specifies how strings are encoded in the intrinsic objects.
    LCID specifies how dates, times, and currencies are formatted.
    SessionID returns the session identifier, a unique identifier that is generated by the server when the session is created.
    Timeout specifies the timeout period assigned to the Session object for this application, in minutes.
    methods
    Abandon specifies how strings are encoded in the intrinsic objects.
    Contents.Remove deletes a specific item from the Session object's Contents collection.
    Contents.RemoveAll deletes all items that have been added to the Session object's Contents collection.

 



 [post]
[permission] read:Anonymous, comment:Anonymous, write:Webmaster, upload:Webmaster, manage:Webmaster
Qindex.info