The Application_OnStart event occurs before the first new session is created, that is, before the Session_OnStart event. Only the Application and Server built-in objects are available. Referencing the Session, Request, or Response objects in the Application_OnStart event script causes an error.
<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Sub Application_OnStart
. . .
End Sub
</SCRIPT>
Sub Application_OnStart
Application("NumberofVisitors") = 0
End Sub
Note There is no need to use Application.Lock and Application.Unlock methods in the Application_OnStart event, as this event can only be called once, by the first session that starts the application.
Application_OnEnd, Session_OnStart