Application_OnStart Event
The Application_OnStart event occurs before the first new session is created, that is, before the Session_OnStart event. 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 causes an error.
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Sub Application_OnStart. . . End Sub
</SCRIPT>
Parameters
- ScriptLanguage
Specifies the scripting language used to write the event script. It may be any supported scripting language, such as VBScript or JScript. If more than one event uses the same scripting language, they can be combined under a single set of <SCRIPT> tags.
Example Code
Sub Application_OnStart
Application("NumberofVisitors") = 0
End Sub
You do not need to use Application.Lock and Application.Unlock methods in the Application_OnStart event, as this event can be called only once, by the first session that starts the application.
Requirements
Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.
Product: IIS