Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

ASP Application_OnEnd Event

  • Last Updated : 01 Feb, 2021

The ASP Application_OnEnd Event occurs after the Application ends or quits.It occurs when the session is over.Thus event is placed in the Global.asa File.This all can be happen omly when the wenserver stopped working.

Note: The only built-in ASP objects available from within the OnEnd event handler are Server and Application.


<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
Sub Application_OnEnd. . . End Sub

Parameter Values 

  • ScriptLanguage: It defjnes the Language of the script which is used to write a event script.It supported different scripting language, such as VBScript or JScript.

Example Code: 

<script Language="VBScript" RUNAT=Server>
Sub Application_OnEnd()
End Sub

Sub Application_OnStart()
    Application("NumSession") = 0
    Application("NumVisited") = 0
End Sub

Sub Session_OnEnd()
    Application("NumSession") = Application("NumSession") - 1
End Sub

Sub Session_OnStart()
    Application("NumSession") = Application("NumSession") + 1
    Application("NumVisited") = Application("NumVisited") + 1
End Sub  

Response.Write "You are " & Application("NumSession") & " of " & Application("NumVisited") & " users."
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!