include files in global.asa file? 
Author Message
 include files in global.asa file?

Is there a way to reference a .inc file in a .asa file?  I have developed
code libraries that are kept in .inc files (plain text) that I want to
reference in the global.asa file.  Using the <!-- #include
file="library.inc" --> tag causes an error.  Is there another way?

--
Sincerely,

Craig Buchanan, President
Cogniza, Inc.
www.cogniza.com
news.cogniza.com
+1.612.824.5858



Sat, 22 Jun 2002 03:00:00 GMT  
 include files in global.asa file?
Sure you can.  Just make sure you use <script> tags, and put the include
file OUTSIDE of them, e.g.:

<!--#include file="library.inc"-->
<script language="VBScript" runat="server">
sub session on_start
    ' ...blah blah
</script>

--
ab/mvp


Quote:
> Is there a way to reference a .inc file in a .asa file?  I have developed
> code libraries that are kept in .inc files (plain text) that I want to
> reference in the global.asa file.  Using the <!-- #include
> file="library.inc" --> tag causes an error.  Is there another way?

> --
> Sincerely,

> Craig Buchanan, President
> Cogniza, Inc.
> www.cogniza.com
> news.cogniza.com
> +1.612.824.5858



Sat, 22 Jun 2002 03:00:00 GMT  
 include files in global.asa file?
Unfortunately, I get this error:

Active Server Pages error 'ASP 0137'

Invalid Global Script

/oracle/node.inc, line 1

Script blocks must be one of the allowed Global.asa procedures. Script
directives within <% ... %> are not allowed within the global.asa file. The
allowed procedure names are Application_OnStart, Application_OnEnd,
Session_OnStart, or Session_OnEnd.

I have scripts included in the .inc files.  Perhaps this is what is
objectionable.

Sincerely,

Craig Buchanan, President
Cogniza, Inc.
www.cogniza.com
news.cogniza.com
+1.612.824.5858


Quote:
> Sure you can.  Just make sure you use <script> tags, and put the include
> file OUTSIDE of them, e.g.:

> <!--#include file="library.inc"-->
> <script language="vbscript" runat="server">
> sub session on_start
>     ' ...blah blah
> </script>

> --
> ab/mvp



> > Is there a way to reference a .inc file in a .asa file?  I have
developed
> > code libraries that are kept in .inc files (plain text) that I want to
> > reference in the global.asa file.  Using the <!-- #include
> > file="library.inc" --> tag causes an error.  Is there another way?

> > --
> > Sincerely,

> > Craig Buchanan, President
> > Cogniza, Inc.
> > www.cogniza.com
> > news.cogniza.com
> > +1.612.824.5858



Sat, 22 Jun 2002 03:00:00 GMT  
 include files in global.asa file?
My apologies in advance for posting JavaScript to a VBScript group.

On IIS4 using JavaScript, I'm successfully doing this by using a script
block inside the include file instead of <% %>.  For example, the include
file utility.inc looks like:

<SCRIPT LANGUAGE=JavaScript RUNAT=Server>
function utilityFunction() {...
... several other functions ...
</SCRIPT>

Then, the global.asa looks like Mr. Bertrand has suggested:

<!--#INCLUDE FILE="include/utility.inc" -->
<SCRIPT LANGUAGE=JavaScript RUNAT=Server>
function Session_OnStart() {
    utilityFunction();
...
</SCRIPT>

I haven't tried this with VBScript, but I would think that it would work the
same.  I'm not sure that it would work if there was any script in the
include file that wasn't inside of a function or subroutine.

HTH,
Jesse


Quote:
> Unfortunately, I get this error:

> Active Server Pages error 'ASP 0137'

> Invalid Global Script

> /oracle/node.inc, line 1

> Script blocks must be one of the allowed Global.asa procedures. Script
> directives within <% ... %> are not allowed within the global.asa file.
The
> allowed procedure names are Application_OnStart, Application_OnEnd,
> Session_OnStart, or Session_OnEnd.

> I have scripts included in the .inc files.  Perhaps this is what is
> objectionable.

> Sincerely,

> Craig Buchanan, President
> Cogniza, Inc.
> www.cogniza.com
> news.cogniza.com
> +1.612.824.5858



Sat, 22 Jun 2002 03:00:00 GMT  
 include files in global.asa file?
Oh yes, your include file must be functions only, not perform any actual
code unless called upon, and be included within <script> tags (NOT <%%>).

--
ab/mvp

Quote:
> Unfortunately, I get this error:

> Active Server Pages error 'ASP 0137'

> Invalid Global Script

> /oracle/node.inc, line 1

> Script blocks must be one of the allowed Global.asa procedures. Script
> directives within <% ... %> are not allowed within the global.asa file.
The
> allowed procedure names are Application_OnStart, Application_OnEnd,
> Session_OnStart, or Session_OnEnd.

> I have scripts included in the .inc files.  Perhaps this is what is
> objectionable.



Sat, 22 Jun 2002 03:00:00 GMT  
 include files in global.asa file?
Jesse-

Thanks that worked.  I had to remove all the "<%" and "%>" tags from my .inc
file and ensure that the <SCRIPT> tags were there as well.

Craig

Craig Buchanan, President
Cogniza, Inc.
www.cogniza.com
news.cogniza.com
+1.612.824.5858



Quote:
> My apologies in advance for posting JavaScript to a VBScript group.

> On IIS4 using JavaScript, I'm successfully doing this by using a script
> block inside the include file instead of <% %>.  For example, the include
> file utility.inc looks like:

> <SCRIPT LANGUAGE=JavaScript RUNAT=Server>
> function utilityFunction() {...
> ... several other functions ...
> </SCRIPT>

> Then, the global.asa looks like Mr. Bertrand has suggested:

> <!--#INCLUDE FILE="include/utility.inc" -->
> <SCRIPT LANGUAGE=JavaScript RUNAT=Server>
> function Session_OnStart() {
>     utilityFunction();
> ...
> </SCRIPT>

> I haven't tried this with VBScript, but I would think that it would work
the
> same.  I'm not sure that it would work if there was any script in the
> include file that wasn't inside of a function or subroutine.

> HTH,
> Jesse



> > Unfortunately, I get this error:

> > Active Server Pages error 'ASP 0137'

> > Invalid Global Script

> > /oracle/node.inc, line 1

> > Script blocks must be one of the allowed Global.asa procedures. Script
> > directives within <% ... %> are not allowed within the global.asa file.
> The
> > allowed procedure names are Application_OnStart, Application_OnEnd,
> > Session_OnStart, or Session_OnEnd.

> > I have scripts included in the .inc files.  Perhaps this is what is
> > objectionable.

> > Sincerely,

> > Craig Buchanan, President
> > Cogniza, Inc.
> > www.cogniza.com
> > news.cogniza.com
> > +1.612.824.5858



Sat, 22 Jun 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Global.asa Include files

2. Global.asa Include files

3. including scripts in global.asa

4. Includes in Global.asa

5. including scripts in global.asa

6. How to <!--#INCLUDE in GLOBAL.ASA

7. Global.asa file

8. Error in my global.asa file!

9. newbie question (Global.ASA file)

10. Using Global.asa File for Password Protection

11. Known bug with Session_OnEnd method in Global.asa file

12. Deleting a file via Global.asa when session ends

 

 
Powered by phpBB® Forum Software