DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    109

    AppSettings Vs. Application Variables

    When do you use AppSettings and Application Variables? I found Application Variables is more flexible to use because they are created in the global class. Some conditions can be considered before putting value in a Application Variable. Do I miss something in AppSettings? Thanks.

    Dan-Yeung

  2. #2
    Join Date
    Dec 2003
    Posts
    78

    AppSetting and Application Variables

    AppSettings allow you to place information in a file that can change from your dev box to the production box. Application variables are a term that is used to describe global variables, I don't believe there is a link between the two.

  3. #3
    Join Date
    Jun 2005
    Posts
    1
    AppSettings and Application variables quite different "places" for using data your application needs. AppSettings, and in reality your app/web.config file, provides a place to put data values that your application can drawn from and act upon, and make changes as necessary, without requiring you to recompile your assembly if you had done it in the global.asax class.

    Now you wouldn't want to do that, would you?

    It is more usual to obtain settings data from AppSettings and planting them into your global Application variables. But know this: the Application class exists in ASP.NET solely for backward compatibility with classic ASP - it should be considered deprecated. Use ASP.NET's "new" Cache mechanism instead, or write your own static configuration class that store/wrap settings data gathered from AppSettings/.config.
    Last edited by icelava; 06-14-2005 at 02:31 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links