How to use ASP & Global.asa This the tutorial/example a scripts how to use ASP & global.asa file. The global.asa file is a filecontain or declared object variables, event and methods that can be accessed by every page in asp runing.
ShotDev Focus:
- ASP & Global.asa
Example
asp_global.asa
<script language="VBScript" runat="Server">
Sub Application_OnStart
Application("OnlineNow") = 0
Application("Msg") = "Welcome to ShotDev.Com"
End Sub
Sub Session_OnStart
Application.Lock
Application("OnlineNow") = Application("OnlineNow")+1
Application.UnLock
End Sub
Sub Session_OnEnd
Application.Lock
Application("OnlineNow") = Application("OnlineNow")-1
Application.UnLock
End Sub
</script>
asp_global.asp
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
Online = <%response.write(Application("OnlineNow"))%><br>
<%=Application("Msg")%>
</body>
</html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_global.asp
Screenshot
.
Link
ASP & Application Object
ASP & Session Object
.
.


