Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include in Global.asa

Status
Not open for further replies.
Joined
May 8, 2004
Messages
92
Location
GB
Hi guys,

My application is using include files again and again. Is it possible for me to define my Include files in the global.asa so that my pages can refernce the include files. e.g

I am just writing this as the first line in my global.asa but not working.
<!-- #INCLUDE FILE="../folder/File.INC" -->

Cheers!
 
you shouldn't be using the ../ in global.asa as it should be in the root directory and from there ../ will reference a folder above the root directory.



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
NO tried that infact pages look for the closest global.asa file.
 
First off, if your file ends in ".inc" anyone can read all the code in it....So I wouldn't advise it. Secondly I believe you should be using actual/physical fully qualified path with "include file" as opposed to "include virtual" where you can type the relative path.
Lastly, if you're tryin to put an include in your global asa, why don't you put the code directly into the global asa file and eliminate the first issue i've mentioned...?

All hail the INTERWEB!
 
RhythmAddict112 has a point. it really doesn't sound right to put a include in a global.asa. kind of odd and takes the functionality of a global.asa out and makes it something its not meant to be.

just something I don't think I would do as simple nature of structuring the app. no good valid reason so I'm sure I'll be shot down soon fo saying it. ;)

___________________________________________________________________

onpnt.com
SELECT * FROM programmers WHERE clue > 0
(0 row(s) affected) -->faq333-3811

 
Unless the only purpose of your INCLUDE file is to set up Session or Application variables then you are best off putting it on the pages that where you need it.

The Seesion_OnStart event in the global.asa file is called once per session and the Application_OnStart event is only called the first time any page in your web app is called after IIS is reset. Since both of these are one time things there is nothing gained by putting these things into an include file when you could just put them directly in the global.asa itself.

INCLUDE files are normally used when there is some HTML or ASPP that you want to appear on multiple pages. Examples might include page header and footer in HTML and for ASP it is not uncommon to use INCLUDEs for ADO database functions and user login testing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top