ASP Session.StaticObjects() - Session Object Gets a collection of objects declared by <object Runat=”Server” Scope=”Session”></object> tags within the ASP application file Global.asa.
ShotDev Focus:
- An Objects Collection containing objects declared in the Global.asa file.
Example
global.asa
<script language="VBScript" runat="Server"> '*** Code ***' </script> <object runat="Server" scope="Session" id="SmartUpload" progid="aspSmartUpload.SmartUpload"></object> <object runat="Server" scope="Session" id="Zip" progid="Pnvzip.ZipFunctions"></object>
asp_session_staticobjects.asp
<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Response.write Session.StaticObjects.Key("SmartUpload") & "<br>"
Response.write Session.StaticObjects.Key("Zip") & "<br>"
Response.write("<hr>")
Dim List
For Each List In Session.StaticObjects
Response.write Session.StaticObjects.Key(List) & "<br>"
Next
Response.write("<hr>")
Dim i
ForĀ i = 1 To Session.StaticObjects.Count
Response.write Session.StaticObjects.Key(i) & "<br>"
Next
%>
</body>
</html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_session_staticobjects.asp
Screenshot
.
.
.


