?
Solved

ASP.NET - Best Place to load Global settings??

Posted on 2005-03-22
4
Medium Priority
?
262 Views
Last Modified: 2006-11-17
Hi,

Cannot seem to find a decent answer so figured someone here would know.

I have an asp.net app that allows a worker to edit certain parts of webpages, these are stored in a db, most of this is  font types, colors, text html etc.

I am wondering if there is a way to somehow save these settings on application (global?) level so that the database need not be hit for each visitor, but if possible to have the app load these settings maybe once a day or only when some one has changed a setting, thus not requireing a hit each time a new visitor reads the page.


Thanks
0
Comment
Question by:flosoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:coopzz
ID: 13610049
well i think MS new way of doing this is in the web.config file, using app settings  eg:

web.config file extract
-----------
<configuration>
  <appSettings>
    <add key="textColor" value="green" />
  </appSettings>
  <system.web>
  etc.....
----------
and this is how to get it
----------
System.Configuration.ConfigurationSettings.AppSettings("textColor")
----------

And when this file is changed the web app restarts and reloads.

CooPzZ
0
 

Author Comment

by:flosoft
ID: 13611710
HI thanks for the comment,

I am storing my connection string in the web.config in a simular fasion, but doing it this way wouldn't it have to read the file every time new visitor arrived? or does it store those settings in memory of the server so no hard disk hit is needed?

Thanks
0
 
LVL 11

Accepted Solution

by:
coopzz earned 200 total points
ID: 13616621
TO be honest I never actually tested it in that way [they don't seem to mind calling a conection string everytime you grab a connection so I never put too much thought into it yet], If your only catering for less that 100 users at a time I wouldn't worry too much, Time To Do some reasearch I guess.

Well If you really want to make sure it's in memory in your global.asax file load all your vars into the applicaiton.contents object.. on the app_Start event so even when the web.config file gets change it will repass though the same procedure and set them up again and then It will be stored in memory.

CooPzZ
0
 

Author Comment

by:flosoft
ID: 13825582
Thanks!
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question