Solved

Use of global.asa

Posted on 2013-01-03
1
314 Views
Last Modified: 2013-01-03
Hi Experts,

Can anyone remind me the use of global.asa?

For example, I currenly have a shopping cart that I wrote my self, all of the prices are hardcoded in one common.asp file that I include where I need it.

Now, I need to store the prices into a db, so management can change them, and within my common.asp I'd get my prices from the db. However, I don't want to open my db every time I include common.asp and waste resources, as I'll be looping through 45 recs every time.

With this said, would this be where global.asa comes in?  I was thinking of having under Session_OnStart

arePricesRetreived = False

Then in common.asp, do:

If arePricesRetreived = False
  'Retrieve from DB
  arePricesRetreived = True
End if

Would this be the propper logic and use of global.asa?
0
Comment
Question by:APD_Toronto
1 Comment
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 38741257
here's a good explanation of global.asa:

http://www.w3schools.com/asp/asp_globalasa.asp

basically, its a place to initiate data and set application and session objects. as for the logic you've suggested, do you need to have this data on every page of your application? I would imagine you don't, and if this is a high traffic website, you're better off only calling it on the pages you actually need. Otherwise you're storing data in memory that may or not be used, and wasting resources. I would recommend creating a function that can be accessed on every page that calls the data and returns it in the format you need, then call that function when and where you need it.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

831 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