Open In App

ASP Contents Collection

Last Updated : 02 Sep, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads