APPENDIX D

Object, Control, and Registry Reference

Table D-1 Window Object Properties


Property Description Syntax
Name The window name. Object.Name
Length The number of HTML elements in the window. Object.Length
Parent Returns a reference to the parent hosting the window. Object.Parent
Self Returns a reference to the Window object itself. Object.Self
Top Returns a reference to the host of the window. Object.Top
Status The text displayed in the status bar of the browser. Object.Status = text
text: the text to display
DefaultStatus The text displayed in the browser by default when there are no other messages to display. Object.DefaultStatus = text
text: the text to display
Opener Returns a reference to the Window object that created the current window. Occurs if code causes a new instance of IE to open. Object.Opener
Closed Indicates whether the window is closed. variable = Object.Closed
variable: returns True if window is closed
Client Returns a reference to the Navigator object. Object.Client
DialogArguments Returns the variable or array of variables passed into the modal dialog window. This property is read-only and applies only to windows created using the ShowModalDialog method. Object.DialogArguments
DialogWidth, DialogHeight Sets the width and height of a window created using the ShowModalDialog method. The default unit is pixels but can be any CSS unit. Object.DialogWidth = value Object.DialogHeight = value
DialogTop, DialogLeft Sets the top and left positions (relative to the upper-left corner of the desktop) of a window created using the ShowModalDialog method. The default unit is pixels but can be any CSS unit. Object.DialogTop = value
Object.DialogLeft = value
Document Returns a reference to the Document object. Object.Document
Event Returns a reference to the Event object in the current event handler. Object.Event
History Returns a reference to the History object. Object.History
Location Returns a reference to the Location object. Object.Location
Navigator Returns a reference to the Navigator object. The Navigator object contains information about the version, name, and supported features of the current browser. Object.Navigator
OffscreenBuffering Indicates whether offscreen buffering is used. Object.OffscreenBuffering = Boolean
ReturnValue Specifies the return value for a window created using the ShowModalDialog method. Object.ReturnValue = value
Frames Accesses the Frames collection. Object.Frames(index)
index: a string or integer specifying the frame to be accessed
Screen Returns a reference to the Screen object. Object.Screen



Table D-2 Window Object Methods


Method Description Syntax
Navigate Forces navigation to a new Uniform Resource Locator (URL). Object.Navigate URL
URL: the target address
Blur Causes an immediate loss of focus and fires the OnBlur event. Object.Blur
Focus Causes the application to receive focus and fires the OnFocus event. Object.Focus
Alert Displays a dialog box with a message and an OK button. Similar to a MsgBox in VBScript. Object.Alert(text)
text: the message to the user
Confirm Displays a dialog box with a message and OK/Cancel buttons. Similar to a MsgBox in VBScript. Returns True if OK is clicked. variable = Object.Confirm
Prompt Displays a dialog box prompting for text input. variable = Object.Prompt (text, default)
text: the message prompting the user
default: the default response from the user
SetTimeout Runs a routine after a specified number of milliseconds have elapsed. variable = Object.SetTimeout (procedure, milliseconds[, language])
procedure: the name of the routine to run
milliseconds: the time delay
language: the scripting language of the procedure
ClearTimeout Cancels a timeout that was set with the SetTimeout method. Object. ClearTimeout (variable)
variable: the return value from the SetTimeout method, which identifies the timeout to be canceled
Close Closes the current window. Object.Close
Open Opens a new stream for input. This uses the Write and WriteLn methods of the Document object to generate the new page. Object.Open([mimetype])
mimetype: the MIME type for the new window input
Scroll Turns scroll bars on and off. Object.Scroll = "Yes"/"No"
ShowModalDialog Displays an HTML dialog box. variable = Object.ShowModal Dialog(URL[, args[, features]])
variable: a reference to the new dialog box
URL: the URL to show
args: the arguments to display
features: the browser features that the dialog box will support
SetInterval Runs a routine after a specified number of milliseconds have elapsed. variable = Object.SetInterval (procedure, milliseconds[, language])
procedure: the name of the routine to run
milliseconds: the time delay
language: the scripting language of the procedure
ClearInterval Cancels an interval that was set with the SetInterval method. Object.ClearInterval(variable)
variable: the return value from the SetInterval method, which identifies the interval to be canceled.
ExecScript Runs a routine. Object.ExecScript(procedure[, language])
procedure: the name of the routine to run
language: the scripting language of the procedure
ShowHelp Displays a Help file. Object.ShowHelp(URL[, args])
URL: the target address of the Help file
args: the display arguments



Table D-3 Window Object Events


Event Description Syntax
OnFocus Fires when the window receives the focus. Sub Window_OnFocus()
End Sub
OnLoad Fires when the current Web page has fully loaded. Sub Window_OnLoad()
End Sub
OnUnload Fires immediately before the current Web page is unloaded. Sub Window_OnUnload()
End Sub
OnBlur Fires immediately before the window loses focus. Sub Window_OnBlur()
End Sub
OnHelp Fires when the F1 key is hit and the window has the focus. Sub Window_OnHelp()
End Sub



Table D-4 Document Object Properties


Property Description Syntax
AlinkColor Specifies the color of an active link. An active link is created when the user has clicked a link but has not yet released the mouse button. Object.AlinkColor = color
color: a string in RGB format or a designated color value (e.g., "WHITE" or "FFFFFF")
LinkColor Specifies the color of a hyperlink that has not yet been visited. Object.LinkColor = color
color: a string in RGB format or a designated color value (e.g., "WHITE" or "FFFFFF")
VlinkColor Specifies the color of a hyperlink that has been visited. Object.VlinkColor = color
color: a string in RGB format or a designated color value (e.g., "WHITE" or "FFFFFF")
Title Sets or returns the title of the current document. Object.Title = text
text: the new title text
BGColor Sets or returns the background color of the current document. Object.BGColor = color
color: a string in RGB format or a designated color value (e.g., "WHITE" or "FFFFFF")
Cookie Reads or writes a cookie to the client. Cookies are small pieces of data stored for later use. Object.Cookie
LastModified Returns the date the page was last changed. Object.LastModified
Location Returns a Location object that contains information about the current URL. Object.Location
Referrer Returns the URL of the previous Location object. Object.Referrer
FGColor Sets or returns the foreground color of the current document. Object.FGColor = color
color: a string in RGB format or a designated color value (e.g., "WHITE" or "FFFFFF")
ActiveElement Returns the element that currently has the focus. Object.ActiveElement
ReadyState Returns the state of the downloading document. Object.ReadyState
Possible values:
   1: the object is unavailable
   2: the object is loading
   3: the object is available but not fully loaded
   4: the object is loaded and available
Domain Returns the host name from where the pages originated. If the domain is the same, code can access pages across frames in the browser. Object.Domain
URL Returns the URL of the document. Object.URL
Body Returns a reference to the Body object associated with this document. Object.Body
ParentWindow Returns a reference to the Window object associated with this document. Object.ParentWindow
Selection Returns a reference to the current Selection object. Object.Selection



Table D-5 Document Object Methods


Method Description Syntax
Close Closes the current document. Object.Close
Open Opens a new stream for the Write and WriteLn methods. Object.Open
Clear Sets or returns a value that determines how text appears beside floating images. Object.Clear = variable
variable: specifies how text appears around floating images:
   1: appears past all floating images
   2: appears past left-aligned floating images
   3: appears past right-aligned floating images
Write Writes HTML to the currently open stream. Object.Write(text)
WriteLn Same as Write but adds a carriage return. Object.WriteLn(text)
ExecCommand Executes a command over the entire selection or range variable = Object.ExecCommand (command[, value[, Boolean]])
command: the command ID to execute
value: the value to assign as a result of the command
Boolean: specifies whether a GUI is presented when necessary (-1, True; 0, False)
QueryCommandEnabled Returns a Boolean value indicating whether a command is available. variable = Object.QueryCommandEnabled
(command)
command: the command ID to execute
QueryCommandValue Returns the current value of a command. variable = Object.QueryCommandValue(command)
command: the command ID to query
QueryCommandText Returns the string associated with a command. variable = Object.QueryCommandText(command)
command: the command ID to execute
ElementFromPoint Returns the element for a specified x,y coordinate. variable = Object.ElementFromPoint(x, y)
QueryCommandSupported Returns whether the current command is available. variable = Object.QueryCommandSupported(command)
command: the command ID to execute
QueryCommandState Returns the current state of a command. variable = Object.QueryCommandState(command)
command: the command ID to execute
QueryCommandIndeterm Returns whether a command is in an indeterminate state. variable = Object.QueryCommandIndeterm(command)
command: the command ID to execute
CreateElement Creates an element object of the specified tag. variable = Object.CreateElement(tag)
variable: a reference to the new element
tag: the new tag to create



Table D-6 Document Object Events


Event Description Syntax
OnClick Fires when the user clicks the document. Sub Document_OnClick()
End Sub
OnMouseOver Fires when the mouse passes over the document. Sub Document_OnMouseOver()
End Sub
OnDblClick Fires when the user doubleclicks the document. Sub Document_OnDblClick()
End Sub
OnKeyPress Fires when a key is pressed. Sub Document_OnKeyPress()
End Sub
OnMouseDown Fires when the mouse button is clicked and down. Sub Document_OnMouseDown
(y, x, shift, button)
End Sub

y,x: the coordinates of the mouse
shift: specifies the state of the Shift, Ctrl, and Alt buttons:
   1: Shift key
   2: Ctrl key
   4: Alt key
button: specifies which button on the mouse was clicked:
   1: Left button
   2: Right button
   4: Middle button
OnMouseMove Fires as the mouse moves over the document. Sub Document_OnMouseMov
(y, x, shift, button)
End Sub

y,x: the coordinates of the mouse
shift: specifies the state of the Shift, Ctrl, and Alt buttons:
   1: Shift key
   2: Ctrl key
   4: Alt key
button: specifies which button on the mouse was clicked:
   1: Left button
   2: Right button
   4: Middle button
OnMouseUp Fires after the mouse button comes up from a click. Sub Document_OnMouseUp
(y, x, shift, button)
End Sub

y,x: the coordinates of the mouse
shift: specifies the state of the Shift, Ctrl, and Alt buttons:
   1: Shift key
   2: Ctrl key
   4: Alt key
button: specifies which button on the mouse was clicked:
   1: Left button
   2: Right button
   4: Middle button
OnKeyDown Fires when a key is pressed and down. Sub Document_OnKeyDown
(shift)End Sub
shift: specifies the state of the Shift, Ctrl, and Alt buttons:
   1: Shift key
   2: Ctrl key
   4: Alt key
OnKeyUp Fires when a key is released after being pressed. Sub Document_OnKeyUp
(shift)End Sub

shift: specifies the state of the Shift, Ctrl, and Alt buttons:
   1: Shift key
   2: Ctrl key
   4: Alt key
OnMouseOut Fires when the mouse leaves the document. Sub Document_OnMouseOut()
End Sub
OnReadyStateChange Fires when the document's ready state changes. Occurs just before the OnLoad event of the window. Sub Document_OnReadyStateChange()
End Sub
OnHelp Fires when F1 is pressed. Sub Document_OnHelp()
End Sub



Table D-7 Event Object Properties


Property Description Syntax
KeyCode Returns or sets the ASCII value of the pressed key that fired the event. Object.KeyCode
FromElement Returns the element the mouse is leaving in a MouseOut or MouseOver event. Object.FromElement
ToElement Returns the element the mouse is entering in a MouseOver or MouseOut event. Object.ToElement
Button Returns the mouse button that fired the event. Object.Button
CancelBubble Stops event bubbling for the event. Object.CancelBubble = value
value: -1 True, 0 False
SrcElement Returns the element involved in the event. Object.SrcElement
X Specifies the x coordinate of the mouse. Object.X
Y Specifies the y coordinate of the mouse. Object.Y
ShiftKey Returns True if the Shift key is down when the event fires. Object.ShiftKey
CtrlKey Returns True if the Ctrl key is down when the event fires. Object.CtrlKey
AltKey Returns True if the Alt key is down when the event fires. Object.AltKey
ReturnValue Allows a return value to be passed back from an event. Object.ReturnValue = value
value: -1 True, 0 False



Table D-8 Tabular Data Control Properties and Methods


Property/Method Description Syntax
CharSet property A string expression that describes the character set used for the data file. If no value is supplied, the input file is assumed to be latin1. If left at its default value or explicitly set to "", the Tabular Data Control will automatically sense whether the input data is a Unicode file. Object.CharSet = value
DataURL property A string that specifies the Internet address of the data file. Object.DataURL = value
EscapeChar property A special character that negates the effect of other characters used to perform functions such as field and column delimiting. For example, if TextQualifier is set to " (doublequote) and you set the EscapeChar property to \ (backslash), the following data file will be interpreted correctly:
   "This is data"
   "This is \"real\" data"
Object.EscapeChar = value
FieldDelim property The character used to mark the end of a data field. The default is a comma. Object.FieldDelim = value
FilterColumn property The name of a column to filter the recordset. Used in conjunction with FilterCriterion and FilterValue properties. Object.FilterColumn = ColumnName
FilterCriterion property A logical operator that determines which records are displayed. This operator can be =, <>, >, <, >=, or <=. Object.FilterCriterion = operator
FilterValue property An expression used to compare with the FilterColumn property using the FilterCriterion property. Object.FilterValue = value
Language property A string that specifies the language of the text data file. Object.Language = language
RowDelim property The character used to specify the end of a row of data. The default is a carriage return. Object.RowDelim = value
SortAscending property A Boolean value that determines how the column specified by the SortColumn property is used to sort the data in the data file. Values are True and False. Object.SortAscending = Boolean
SortColumn property The column to be used with the SortAscending property to sort the order of rows in the data file. Object.SortColumn = ColumnName
TextQualifier property A character used to delineate text strings in the file. The default is a " (double quote). Object.TextQualifier = value
UseHeader Property A Boolean value that specifies whether the first row in the data file contains names for the columns. Object.UseHeader = Boolean
Reset method A method that causes the TDC to re-sort the data based on the new property settings. Object.Reset



Table D-9 Advanced Data Control Properties and Methods


Property/Method Description Syntax
Connect property The string used to identify the data source for the ADC. Object.Connect = "
DSN=datasource;
UID=userID;
PWD=password;"
RecordSet property A property that allows access to the underlying recordset contained in the ADC. Object.Recordset
Server property A property that indicates the server name and protocol for accessing data. Object.Server = value
HTTP
<PARAM NAME="Server"
VALUE="http://awebsrvr:port">
HTTPS
<PARAM NAME="Server"
VALUE="http://awebsrvr:port">
DCOM
<PARAM NAME="Server"
VALUE="machinename">
In-process
<PARAM NAME="Server"
VALUE="">
SQL property The Structured Query Language statement for the resulting recordset. Object.SQL = value
CancelUpdate method A method that cancels all changes to the recordset. Object.CancelUpdate
MoveFirst, MoveLast, MoveNext, MovePrevious methods Methods that navigate the recordset rows. Object.MoveFirst
Object.MoveLast
Object.MoveNext
Object.MovePrevious
Refresh method A method that forces a requery of the data source. Object.Refresh
SubmitChanges method A method that sends changes made to the recordset to the server for updating the database. Object.SubmitChanges



Table D-10 Application Object Methods


Method Description Syntax
Lock method Prevents access to the Application variables collection. Application.Lock
UnLock method Allows access to the Application variables collection. Application.UnLock



Table D-11 Session Object Properties and Methods


Property/Method Description Syntax
SessionID property Returns the ID number for the current session. Session.SessionID
Timeout property Sets or returns the lifetime of the session in minutes. Defaults to 20 minutes. Session.Timeout
Abandon method Immediately terminates the session. Session.Abandon



Table D-12 Request Object Properties


Property Description Syntax
ClientCertificate A collection of values stored in property the client certificate. Request.ClientCertificate(variable)
Cookies property A collection of values sent as cookies with the HTTP header. Request.Cookies(variable)
Form property A collection of data sent with a submitted form. Request.Form(fieldname)
QueryString property A collection of data sent as part of a hyperlink. Request.QueryString(fieldname)
ServerVariables A collection of server property environment variables. Request.ServerVariables(variable)



Table D-13 Response Object Properties and Methods


Property/Method Description Syntax
Buffer property Determines whether page output is buffered. Response.Buffer = True|False
ContentType property Specifies the HTTP content type for the current response. Response.ContentType = "text/HTML"
Cookies property Allows values to be written to the client's cookies collection. Response.Cookies(cookiename)(key) = value
Expires property Sets the amount of time before a cached page expires. Setting to zero causes immediate expiration. Response.Expires = time
ExpiresAbsolute property Sets a date and time on which a cached page expires. Response.ExpiresAbsolute = #date#
Status property Sets the status line returned by the server. Can be used to set messages such as "401 - Not Found." Response.Status = "401 - Not Found"
AddHeader method Allows the addition of a custom header to the Web page. Response.AddHeader name, value
AppendToLog Allows the addition of method information to the Web server log entry for this request. Response.AppendToLog string
BinaryWrite method Writes binary data to a page for use by client objects. Response.BinaryWrite data
Clear method Erases buffered ASP output. Response.Clear
End method Stops ASP processing and sends the result to the client. Response.End
Flush method Empties the buffer and sends the result to the client. Response.Flush
Redirect method Instructs the client to connect to a different URL. Response.Redirect URL
Write method Writes output to the HTML page. The equal sign serves as a shorthand notation. Response.Write data



Table D-14 Server Object Properties and Methods


Property/Method Description Syntax
ScriptTimeout property Sets the time that a script can run before a message appears on the client. Server.ScriptTimeout = time
CreateObject method Creates an instance of an ActiveX component for use in ASP. variable = Server.CreateObject(ProgID)
HTMLEncode method Provides HTML encoding for a given string. variable = Server.HTMLEncode(string)
MapPath method Returns the complete directory structure for a virtual directory name. path = Server.MapPath(virtualdirectory)
URLEncode method Provides URL encoding for a given string. variable = Server.URLEncode(string)



Table D-15 ActiveX Data Objects


Object Description
Command Executes an operation against an ODBC data source. The operation can be an SQL statement or a stored procedure.
Connection Establishes a connection to an ODBC data source.
Error Returns ODBC driver errors.
Field Allows access to a specific field inside of a set of records.
Parameter Allows values to be passed to a Command object.
Recordset Represents a set of records returned from a Command object.



Table D-16 Key Registry Entries


Registry Entry
HKEY_LOCAL_MACHINE
\SYSTEM
\CurrentControlSet
\Services
\W3SVC
\ASP
\Parameters
Allowed Values Description
AllowOutOfProcCmpts 0: False (default)
1: True
Determines whether ASP supports out-of-process components. Must be set to True when using Microsoft Transaction Server.
AllowSessionState 0: False
1: True (default)
Determines whether ASP can access session variables and utilize session events.
BufferingOn 0: False (default)
1: True
Determines whether ASP buffers all generated output before sending the results to a client browser.
DefaultScriptLanguage Any string allowed
VBScript (default)
The name of the default scripting language.
EnableParentPaths 0: False
1: True (default)
Determines whether ASP can use double dots (..) to access parent directories.
LogErrorRequests 0: False
1: True (default)
Determines whether ASP logs failures to the Windows NT event log.
MemFreeFactor 50-150
50 (default)
The maximum length of the free memory list as a percentage of the used memory list.
MinUsedBlocks 5-20
10 (default)
The minimum length of the used memory list before elements can be freed.
NumInitialThreads 1-10
2 (default)
The number of threads created by ASP when it starts.
ProcessorThreadMax 1-C8
10 (default)
The maximum number of threads per processor.
RequestQueueMax 1-FFFFFFFF
500 (default)
The number of requests that can wait in a queue for each thread before generating a Server Too Busy error.
ScriptEngineCacheMax 0-FFFFFFFF
30 (default)
The number of ActiveX server engines that can exist in memory.
ScriptErrorMessage String The error message displayed in the browser if ScriptErrorsSentToBrowser is set to False.
ScriptErrorsSentToBrowser 0: False
1: True (default)
Determines whether ASP sends debugging error messages to the browser.
ScriptFileCacheSize 0-FFFFFFFF
-1 (default)
Sets memory to be used for caching script results. -1 indicates that all pages should be cached.
ScriptFileCacheTTL 0-FFFFFFFF
300 secs (default)
The amount of time scripts will remain in memory cache.
ScriptTimeout 0-FFFFFFFF
90 secs (default)
The time allowed before a running script is terminated. (E.g., this can happen in an endless loop.)
SessionTimeout 0-FFFFFFFF
20 mins (default)
The amount of time that session variables are saved.
StartConnectionPool 0: False
1: True (default)
Turns on ODBC connection pooling for ASP. (Do not confuse this with pooling accomplished by MTS.)
ThreadCreationThreshold 0-FFFFFFFF
5 (default)
The number of waiting thread requests before a new thread is created.



Programming Active Server Pages
Programming Active Server Pages (Microsoft Programming Series)
ISBN: 1572317000
EAN: 2147483647
Year: 1996
Pages: 84

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net