web 2.0

ASP Session.StaticObjects() - Session Object

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

ASP & Session.StaticObjects()

.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.