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
Solved

Use of global.asa

Posted on 2013-01-03
1
316 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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