please dont rip this site
Platform SDK: IIS SDK
      [IIS 5.0] [IIS 5.1] [IIS 6.0]

Application.Contents Collection

The Contents collection contains all the items that have been added to the application through a script command. You can use the Contents collection to obtain a list of items that have been given application scope or to specify a particular item to be the target of an operation. You can also remove items from the collection by using the Remove and RemoveAll methods.

Syntax

Application.Contents(Key)

Parameters

Key
Specifies the name of the item to retrieve.

Methods

Application.Contents.Remove Deletes an item from the collection.
Application.Contents.RemoveAll Deletes all items from the collection.

Remarks

The Contents collection contains those items that have been declared at the application level without using the <OBJECT> tags. This would include both objects created by using Server.CreateObject, as well as scalar variables established through an Application declaration. In the following script, for example, both "strHello" and objCustom would be members of the Contents collection.

<% 

 Application("strHello") =index.html "Hello"

 Set Application("objCustom") = Server.CreateObject("MyComponent") %>

The Contents collection supports For...Each and For...Next iteration. The following script illustrates each of these methods of iterating through the Contents collection:

<%

  Application("strText1") =index.html "1234567890"

  Application("strText2") = "ABCDEFGHIJ"

  Application("strText3") = "A1B2C3D4E5"

%>



<%

  For Each Key in Application.Contents

    Response.Write Key + " = " + Application(Key) + "<BR>"

  Next

%>



<%

  For intItem = 1 to Application.Contents.Count

    Response.Write CStr(intItem) + " = "  

    Response.Write Application.Contents(intItem) + "<BR>"

  Next

%>

You can see a working sample .asp file that uses the Contents collection in the Building ASP Applications section of the Samples.

Requirements

Platforms: Windows 2000 with IIS 5.0 installed, Windows XP with IIS 5.1 installed, Windows Server 2003 family with IIS 6.0 installed

Platform SDK Release: February 2003
What did you think of this topic?
Order a Platform SDK CD


file: /Techref/language/asp/obj/ref_vbom_apoccc.htm, 4KB, , updated: 2003/5/15 13:13, local time: 2024/12/2 18:10,
TOP NEW HELP FIND: 
18.97.14.83:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/techref/language/asp/obj/ref_vbom_apoccc.htm"> Application.Contents Collection</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .