Thus after review of all these methods we can see that you may need to use each of these methods in your application and real choice will depend on the specific of your application.
The following table will help you to choose method, which will most appropriate for your certain ASP.NET application.
Condition |
Appropriate method |
You need to store the internal application settings and you don't need anyone except you to change these settings (for example, developer name, copyright, critical system setting) |
You should choose storing of settings in Global asax file (Method 1). |
Application settings, which don't need to be frequently changed. Application users can't change these setting, however you need to allow application administrator changing these settings. |
You should choose the storing of your setting in Web.config file (Method 2). To reduce system resources related to file-based operation you can combine this method with using Application and Session objects. |
Any changeable application settings if you don't have database installed. |
Application settings, which changes very often, and application settings, which have to be changeable by application users. |
You should choose the storing application settings in database. To reduce the number of requests to database you can combine this method with using Cache and Session objects. |