Language: Classic ASP
How to include an external file in global.asa
global.asa is an optional file used by just about every Classic ASP site of any complexity. It can contain declarations of objects, variables, and functions used throughout the site.
Benefits to global.asa include:
- Declarations made in global.asa are available in ASP page of the site.
The global.asa file is stored in the root directory and loaded by IIS automatically each time a page is called.
To include an external file in global.asa simply add this code and change “./myFileName.asp” to reference the desired file and location.
<!– #include file=”./myFileName.asp” –>
Including external files can be handy if you want to save yourself from repeating code unnecessarily. For example I might include my dbConnect file to help guarantee my connection string is defined and ready for use throughout the site.