Name

RemoveAll — Application.Contents.RemoveAll

Synopsis

Removes all members from the Contents collection. An addition in IIS 5.0, the RemoveAll method allows you to remove from memory all application-scoped variables without unloading the application itself.

Parameters

None

Example

The following script removes all members of the Contents collection:

<%
' This script assumes you have set up two greeting salutations for all 
' the members of your site based on time of day. You want to now remove 
' these from your site.
strAppMorningGreeting = Application("strAMGreet")
strAppEveningGreeting = Application("strPMGreet")

.
.
.
Application.Contents.RemoveAll
.
.
.
%>

Notes

Like the Remove method, the RemoveAll method is an important addition to the Contents collection because it allows for better memory control and cleanup. It allows you to remove all application-scoped variables without unloading the application itself.

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.