CoverYourASP --> Application variables

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
23 active users
43 visitors today
44 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2016 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Application variables were under-used on my site, but not for long! I realized recently that a list box that I was populating with data from my database changed very rarely.

So why should every visitor to the site have to cause an identical database query? The simple answer is to take advantage of Application variables. Think of the "Application" in this case being IIS - the server. Once set, Application variables are available to all pages on your site. But it's important to remember that they are gone forever if the server is restarted.

Using Application variables is easy - all you need are statements like:

// to set the data
Application ( 'Data' ) = 'something';

// to use the data
Response.Write ( 'data is ' + Application ( 'Data' ) );

Part 2: Storing HTML...

Featured sponsor
My favorite resources


See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!


I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...