<%@ LANGUAGE = VBScript %> <% Option Explicit %> <% Response.Expires= -1 %> ASP Server Side Objects

ASP Server Side Objects:
Session, Application & Server

Application.Contents Object

<% Dim x Application.Contents("TestApplicationObject1") = "Test1" Application("TestApplicationObject2") = "Test2" response.write("

Application.Contents.Count = " & Application.Contents.Count & "

") response.write("") With Application for Each x in .Contents response.write("") response.write (" ") response.write (" ") response.write ("") next End With response.write("
" + x + "") response.write ( .Contents(x) ) response.write ("
") %>

Application.StaticObjects

<% response.write("

Application.StaticObjects.Count = " & Application.StaticObjects.Count & "

") response.write("") With Application for Each x in .StaticObjects response.write("") response.write (" ") response.write (" ") response.write ("") next End With response.write("
" + x + "") response.write ( .StaticObjects(x) ) response.write ("
") %>

Session.Contents

<% response.write("

Session.Contents.Count = " & Session.Contents.Count & "

") response.write("") With Session for Each x in .Contents response.write("") response.write (" ") response.write (" ") response.write ("") next End With response.write("
" + x + "") response.write ( .Contents(x) ) response.write ("
") %>

Session.StaticObjects

<% response.write("

Session.StaticObjects.Count = " & Session.StaticObjects.Count & "

") response.write("") With Session for Each x in .StaticObjects response.write("") response.write (" ") response.write (" ") response.write ("") next End With response.write("
" + x + "") response.write ( .StaticObjects(x) ) response.write ("
") %>

Server Objects

<% ' ??? Server.ScriptTimeout response.write("Server.HTMLEncode = " & Server.HTMLEncode("") & "
" ) response.write("Server.URLEncode(""http://www.michael-thomas.com"") = " & Server.URLEncode("http://www.michael-thomas.com") & "
" ) response.write("Server.MapPath(""."") = " & Server.MapPath(".") & "
" ) %>

Cookies

<% response.write("

# of Cookies (Request.Cookies.Count) = " & Request.Cookies.Count & "

") response.write("") With Request for Each x in .Cookies response.write("") response.write ("") response.write ("") response.write("") next End With response.write("
" + x + "") response.write ("# of sub keys = " & .Cookies(x).count ) if .Cookies(x).count then response.write ("

") end if for each subkey in .Cookies(x) response.write ( subkey & " = " & .Cookies(x)(subkey) & "
" ) next response.write ("
") %>

URL Parms

<% // Request.QueryString.Count response.write("

# of URL Parms (Request.QueryString.Count) = " & Request.QueryString.Count & "

") response.write("") With Request for Each x in .QueryString response.write("") response.write ("") response.write("") next End With response.write("
" + x + "" + .QueryString(x) + "
") %>

Request Function

Note: These must be added manually by the programmer.
See code for an example. Gets the URL parm like Request.QueryString("parm name") command

<% response.write("request(""User"") = " & request("User") & "
") %>

Request.ServerVariables

<% response.write("

# of URL Parms (Request.ServerVariables.count) = " & Request.ServerVariables.count & "

") response.write("") With Request for Each x in .ServerVariables response.write("") response.write ("") response.write("") next End With response.write("
" + x + "" + .ServerVariables(x) + "
") %>

Session Variables

Note: These must be added manually by the programmer.

<% ' response.write("1 = " & Session("Example") & "
") %>