Skip to content
Related Articles

Related Articles

ASP Contents Collection
  • Last Updated : 02 Sep, 2020

The ASP Contents Collection is used for collecting the items which are appended to the Application object by using script command.  This Collection can also be used to provide a list of items that have been given application scope, 

The Contents.Remove and Contents.RemoveAll methods can be used to remove some or all of the items from the collection. 

Syntax

Application.Contents(Key) 

Parameter Values:

  • Key: It contains a single value i.e Key which represents the name of the items.

Example 1: We use to add names and objects that would be added to the contents collections.

<%
Application("name")="GeeksForGeeks"
Set Application("objtest")=Server.CreateObject("ADODB.Connection")
%> 

Example 2: 

<%
Application("author")="GeeksforGeeks"
Application("Contributors")="Rahul Jain"

for each x in Application.Contents
 Response.Write(x & "=" & Application.Contents(x) & "<br>")
next
%>

Output 

author=GeeksforGeeks
Contributors=Rahul Jain
My Personal Notes arrow_drop_up
Recommended Articles
Page :