Application| an ASP based application consists of all the files in its root directory and its subdirectories. The application starts when a user first opens a Web page in the application,
Terminates when the service is closed. The application has two events, namely the Application_OnStart event and the Application_OnEnd event.
Users can specify scripts for these events in the Global.asa file. When the application starts, the server looks up and processes in the Global.asa file
Application_OnStart event script. When the application terminates, the server processes the Application_OnEnd event script.
1.application_onstart
The Application_OnStart event occurs before the first time a new session (that is, a Session_OnStart event) is created. Only Application and Server built
The object is available. Referencing the session, Request, or Response object in the Application_OnStart event script results in an error.
Grammar
<script language=scriptlanguage runat=server> Sub Application_OnStart ... End Sub
</SCRIPT>
Parameters
ScriptLanguage
Specifies the scripting language used to write event scripts. It can be any language that supports scripting, such as VB script or JScript. If multiple events use the same
Scripting languages, you can organize them under a <SCRIPT> tag.
2.application_onend
The Application_OnEnd event occurs after the application exits after the Session_OnEnd event, and only application and Server-built objects are available.
Grammar
<script language=scriptlanguage runat=server> Sub application_onend ... End Sub
</SCRIPT>
Parameters
ScriptLanguage
Specifies the scripting language used to write event scripts. Can be any language that supports scripting, such as VBScript or JScript. If there are multiple events using the same
A scripting language in which you can organize them under a set of <SCRIPT> tags.
Comments
The MapPath method cannot be invoked in the Application_OnEnd script.