Link:http://output.to/sideway/default.asp?qno=120200037 Application_OnStart / Application_OnEnd Application ObjectOne of the key functions of Application Object is the application control on the server. Application_OnStart EventApplication_OnStart Event occurs on the start of the Application before the first Session_OnStart event. Available objects are Application Object and Server Object built-in objects. Syntax:
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Or in Global.asa. Imply
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Parameters:ScriptLanguage The parameter "ScriptLanguage" is used to specify the scripting language used in writing the event script. Script The parameter "Script" is the program written by the scripting language for the script interpreter of the Web Server. Remarks:The scipting language can be any supported language, such as VBScript or JScript. When more than one event using the same scripting language, all event sub-rountine can be combined under a single set of <SCRIPT> tags. In the Application_OnStart script, only the Application Object and Server Object built-in objects are available. Referencing the Session Object, Request Object, or Response Object objects in the Application_OnStart event script will cause an error. Since the Application_OnStart script can be called only once by the first session when the application start, Application.Lock and Application.Unlock methods are not needed, . Examples:
Application_OnEnd EventApplication_OnEnd Event occurs on the end of the Application after all the Session_OnEnd event. Available objects are Application Object and Server Object built-in objects. Syntax:
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Or in Global.asa. Imply
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Parameters:ScriptLanguage The parameter "ScriptLanguage" is used to specify the scripting language used in writing the event script. Script The parameter "Script" is the program written by the scripting language for the script interpreter of the Web Server. Remarks:The scipting language can be any supported language, such as VBScript or JScript. When more than one event using the same scripting language, all event sub-rountine can be combined under a single set of <SCRIPT> tags. In the Application_OnEnd script, only the Application Object and Server Object of built-in objects are available, however the Server.MapPath method is not available. And by default, Application_OnEnd runs as the Anonymous User, as defined for the application. If there isn't an Anonymous user, or the Logon for the Anonymous user fails, the OnEnd function will not be called, and an event will be logged. Examples:
Link:http://output.to/sideway/default.asp?qno=120200039 Contents / StaticObjects Application ObjectOne of the key functions of Application Object is the application data control on the server. Application.Contents CollectionApplication.Content Collection adds or sets the value of an item of the Contents collection of Application object through script commands. Syntax:Application.Contents( Key) Or in an ASP file. Imply <% Application.Contents( Key) %> Parameters:Key The parameter "Key" is used to specify the name of the item to retrieve. Remarks:The Contents collection contains only the list of items that have been declared in application scope using script commands not the <OBJECT> tags. Therefore both an application declaration and objects created by using the Server.CreateObject are contained in the Contents Collection The Contents collection can be used to obtain the list of items or a particular item that have been declared in application scope. But the items in the Contents collection can only be removed from the collection by using the Remove and RemoveAll methods. The Contents Collection is in the form of collection, the values of the keys of the cotents collection should be retrieved using a for each element loop in order to get the name of the element. Or using a for index loop is the key is predetermined.. Examples:
Application.StaticObjects CollectionApplication.StaticObjects Collection collects all objects added to the session through the <OBJECT> tag within the Application scope Syntax:Application.StaticObjects( Key) Or in an ASP file. Imply <% Application.StaticObjects( Key) %> Parameters:Key The parameter "Key" is used to specify the name of the item to retrieve. Remarks:The StaticObjects collection contains only the list of items that have been declared in application scope using <OBJECT> tags not the script commands. Therefore both an application declaration and objects created by using the Server.CreateObject are contained in the Contents Collection not in StaticObject collection. The StaticObjects collection can be used to obtain the list of items or a particular item that have been declared in application scope. The StaticObjects Collection is in the form of collection, the values of the keys of the StaticObjects collection should be retrieved using a for each element loop in order to get the name of the element. Examples:
Link:http://output.to/sideway/default.asp?qno=120200036 ASP Object Built-in ASP ObjectsASP objects are the intrinsic COM objects provided by the ASP engine for creating ASP pages. And the interactive web application can then be built through the using of these built-in objects in the web pages. Methods, Properties, Collections and Events of built-in ASP objects. |
Sideway BICK Blog 11/02 |