Solved

Use of global.asa

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help editing script 3 84
Passing Parameter to Stored Procedure 4 32
alert(innerHTML); 8 38
How to post data to an API using ASP Classic 3 24
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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…

679 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