Server Object | |
The Server object provides a series of methods and properties that are useful in scripting with ASP. The most obvious is the Server.CreateObject method, which properly instantiates other COM objects within the context of the current page or session. There are also methods to translate strings into the correct format for use in URLs and in HTML, by converting non-legal characters to the correct legal equivalent. |
ScriptTimeout | |
Integer |
Property |
Has the default value 90. Sets or returns the number of seconds that script in the page can execute for before the server aborts page execution and reports an error. This automatically halts and removes from memory pages that contain errors that may lock execution into a loop or those that stall while waiting for a resource to become available. This prevents the server becoming overloaded with badly behaved pages. You may need to increase this value if your pages take a long time to run. |
CreateObject("identifier") | |
|
Method |
Creates an instance of the object (a component, application or scripting object) that is identified by "identifier", and returns a reference to it that can be used in our code. Can be used in the global.asa page of a virtual application to create objects with session-level or application-level scope. The object can be identified by its ClassID (i.e. "{CLSID:FDC8-...-37A9}") value or by a ProgID string such as "ADODB.Connection". |
Execute("url") | |
|
Method |
Stops execution of the current page and transfers control to the page specified in "url". The user's current environment (i.e. session state and any current transaction state) is carried over to the new page. After that page has finished execution, control passes back to the original page and execution resumes at the statement after the Execute method call. |
GetLastError() | |
Returns a reference to an ASPError object that holds details of the last error that occurred within the ASP processing, i.e. within asp.dll. The information exposed by the ASPError object includes the file name, line number, error code, etc. |
HTMLEncode("string") | |
|
Method |
Returns a string that is a copy of the input value "string" but with all non-legal HTML characters such as '<', '>', '&' and double quotes converted into the equivalent HTML entityi.e. <, >, &, ", etc. |
MapPath("url") | |
|
Method |
Returns the full physical path and filename of the file or resource specified in "url". |
Transfer("url") | |
|
Method |
Stops execution of the current page and transfers control to the page specified in "url". The user's current environment (i.e. session state and any current transaction state) is carried over to the new page. Unlike the Execute method, execution does not resume in the original page, but ends when the new page has completed executing. |
URLEncode("string") | |
|
Method |
Returns a string that is a copy of the input value "string" but with all characters that are not valid in a URL, such as '?', '&' and spaces, converted into the equivalent URL entityi.e. '%3F', '%26', and '+'. |