|
|
|
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
Properties
The Session object has four properties:
- CodePageBy 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.
- LCIDYou 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.
- SessionIDThe 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 users session. The syntax for using the SessionID property is
Session.SessionID
- TimeOutThe 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 systems 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:
- CreateObjectBy using the CreateObject method, you can create a Server objects instance. The CreateObject methods syntax is
Server.CreateObject( progID )
where progID is the class ID of the objects instance you want to create. The following line of code, for example, will create the Browser Detection Active Server objects instance:
Set BrowserType=Server.CreateObject(MSWC.BrowserType)
After you create a Server objects instance, you can access the objects 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.
- MapPathBy using the MapPath method, you can map a physical or virtual path to a directory on the server. The MapPath methods syntax is
Server.MapPath( path )
where Server is the Active Server and path is the virtual or physical directory.
- HTMLEncodeBy 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 methods syntax is
Server.HTMLEncode( string )
where Server is the Active Server and string is the string to be HTML-encoded.
- ULREncodeBy 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 methods 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:
- ScriptTimeOutThe 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 propertys 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 systems 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:
- BufferYou can use the Buffer property to turn the servers 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 servers buffering on:
<%Response.Buffer=True%>
- ExpiresBy 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.
- ExpiresAbsoluteBy 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]]
- IsClientConnectedBy 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()
- StatusThe 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.
|