home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Properties

The Session object has four properties:

  CodePage—By using the CodePage property, you can set your Web pages’ attributes. The syntax for the CodePage property is
Session.CodePage = CodePage

where CodePage is a valid code page for the scripting engine.
  LCID—You use the LCID property to set the local date, time, and currency formats. As a result, you can control the display formatting of your ASP pages based on a particular locale or region. The syntax for using the LCID property is
Session.LCID(=LCID)

where LCID is a valid local identifier.
  SessionID—The SessionID property represents a unique user session. When a user initiates a session with your Web application, the Web server will automatically generate a SessionID for the user’s session. The syntax for using the SessionID property is
Session.SessionID
  TimeOut—The TimeOut property represents the amount of time the user session will remain active before the Web server will close the Session object. The syntax for using the TimeOut property is
Session.Timeout [=nMinutes]

where Session is the Session object and you specify the TimeOut in number of minutes. The default is 20 minutes. The server will store the TimeOut within your system’s Registry. The following line of code, for example, will override the default value:
<%Session.Timeout=1%>

The Server Object

By using the Server object, you can manage and administer your Web server. The Server object includes the methods and properties described in the following sections.

Methods The following methods are supported by the Serverobject:

  CreateObject—By using the CreateObject method, you can create a Server object’s instance. The CreateObject method’s syntax is
Server.CreateObject( progID )

where progID is the class ID of the object’s instance you want to create. The following line of code, for example, will create the Browser Detection Active Server object’s instance:
Set BrowserType=Server.CreateObject(“MSWC.BrowserType”)

After you create a Server object’s instance, you can access the object’s methods and properties within your ASP file. An object whose instance you create within an ASP file will have page-level scope. An object whose instance you create within the global.asa file will have application or session-level scope, depending on whether you use the application or session object.
  MapPath—By using the MapPath method, you can map a physical or virtual path to a directory on the server. The MapPath method’s syntax is
Server.MapPath( path )

where Server is the Active Server and path is the virtual or physical directory.
  HTMLEncode—By using the HTMLEncode method, you can encode a string using the HTML encoding methods. Typically, you will use the HTMLEncode method to pass encoded information from the server to the client. The HTMLEncode method’s syntax is
Server.HTMLEncode( string )

where Server is the Active Server and string is the string to be HTML-encoded.
  ULREncode—By using the URLEncode method, you can encode a string using the URL encoding methods. Typically, you will use the URLEncode method to pass encoded information from the client to the server. The URLEncode method’s syntax is
Server.URLEncode( string )

where Server is the Active Server and string is the string to be encoded.

Properties The following property is supported under the Server object:

  ScriptTimeOut—The ScriptTimeOut property indicates the amount of time the server will wait to process a script before the server will terminate the script processing. The ScriptTimeOut property’s syntax is
Server.ScriptTimeout=Seconds

where Server is the Active Server and you specify the script timeout in seconds. The default timeout value is 90 seconds. The value is stored within your system’s Registry. To change the default value to 30 seconds, for example, you can use the following line of code within your ASP file:
Server.TimeOut=30

The Response Object

By using the Response object, you can send information from the server to the client. The Response object includes the methods and properties described in the following sections.

Properties The Response object has the following properties:

  Buffer—You can use the Buffer property to turn the server’s buffering on or off. The syntax for using the Buffer property is
Response.Buffer=[flag]

where flag equals True if you want to turn the buffering on or False if you want to turn the buffering off. The following line of code, for example, will turn the server’s buffering on:
<%Response.Buffer=True%>
  Expires—By using the Expires property, you can control the amount of time before the browser will remove the page from its cache. The syntax for using the Expires property is
Response.Expires=[number]

where number equals the number of minutes you want the browser to keep the page active within its cache.
  ExpiresAbsolute—By using the ExpiresAbsolute property, you can specify the exact date and time when the browser should remove the page from its cache. The syntax for using the ExpiresAbsolute property is
Response.ExpiresAbsolute=[[date][time]]
  IsClientConnected—By using the IsClientConnected property, you can determine whether the client was disconnected since the last time the Web server sent data to the browser. The syntax for using the IsClientConnected property is
Response.IsClientConnected()
  Status—The Status property controls the status line the Web server will return. The syntax for using the Status property is
Response.Status=StatusCodeAndDescription

where StatusCodeAndDescription includes the status code and description.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.