Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global file
Message
 
To
05/07/2000 16:42:40
Christian Bellavance
Université du Québec à Hull
Hull, Quebec, Canada
General information
Forum:
Internet
Category:
Active Server Page
Title:
Miscellaneous
Thread ID:
00388532
Message ID:
00388577
Views:
7
Server-Side Includes (SSI) will do this for you. Create an asp page, let's call it constants.asp. Declare all your constants in it. Now at the top of every ASP page where you need to reference the constants, put the following line:

<!-- #INCLUDE FILE="constants.asp" -->


Now those constants will be available to any page where you place the SSI directive. These include files can contain anything from constant declarations to entire blocks of server side script. One caveat: Server-side includes are processed before any server-side script is processed. This means you cannot conditionally load an include based on a variable or some other condition.

The other option that Wayne alluded to is to place all the constants into the Application object using the Application_OnStart event in the file global.asa. However, in my experience, global.asa hasn't been 100% reliable although it's usually the OnEnd events that give the most trouble.

HTH

>Is it possible to add an asp file in an asp file wich will act as a global file that can include constante or global variable that will be use pas more than one file.
>
>Thanks.
"It is an important and popular fact that things are not always what they seem. For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much -- the wheel, New York, wars and so on -- whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man -- for precisely the same reasons." - Douglas Adams
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform