include file in global.asa

A

abcd

I have written general purpose functions in one of the include file, I want
to use the same in the global.asa. Do you know how to use include file in
global.asa

thanks in advance.
 
E

Evertjan.

abcd wrote on 30 Sep 2006 in microsoft.public.inetserver.asp.general:
I have written general purpose functions in one of the include file, I
want to use the same in the global.asa. Do you know how to use include
file in global.asa

This has no use, since global.asa is only executed at the beginning of an
application, and the sub session_onstart only at the beginning of a
session, so your include wil not be not part of any page.

the functions will not be available,
[unless you put them in strings as application or session variables,
which still needs them to be eval()ed on page].

Better include all relevant .asp pages with your include.
 
P

Patrice

You'll have to include your file in all pages. My personal preference is to
have a least a single file that is always included in all pages. Then this
general include file includes in turns general purpose files. This way if I
want to add something adding it to the general include file will be enought.
 
A

Anthony Jones

abcd said:
I have written general purpose functions in one of the include file, I want
to use the same in the global.asa. Do you know how to use include file in
global.asa

thanks in advance.

Global.asa file is just another ASP file. You can include another file as
you would in any other ASP file.
 
A

Aleks_Kleyn

My experiance shows that when we use include in asp page it is hard to
manage proper design of this page. If you need to keep the same
functionality in different asp pages you can create separate class or
web user control.
Aleks Kleyn
 
B

Bob Barrows [MVP]

My experiance shows that when we use include in asp page it is hard to
manage proper design of this page. If you need to keep the same
functionality in different asp pages you can create separate class or
web user control.
Aleks Kleyn

"web user control"? In classic ASP?
 
A

Anthony Jones

My experiance shows that when we use include in asp page it is hard to
manage proper design of this page. If you need to keep the same
functionality in different asp pages you can create separate class or
web user control.
Aleks Kleyn

If you are saying that it isn't a good idea to allow includes to generate
output to response just by being included I would agree with you. I use
includes to provide access to a library of functions (usually encased in
classes to avoid name collisions). That was the gist of the OP though.
Thanks for sharing though ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top