PDA

View Full Version : global.asa file


robsecord
08-23-2003, 08:29 AM
I need help with finding the "global.asa" file in my ASP site, if one wasn't provided when registering, do I just create one? And where do I put it? The root of my dir structure is ht_docs i think..

I basically need to create Application and Session level variables and would like to do it in the Application_OnStart and Session_OnStart subs.

Could someone who knows about this pleae help me? I greatly appreciate any advice I could receive on this matter [:D].

R. Secord, B.Sc., CTO MorphixTech

robsecord
09-04-2003, 07:54 AM
Well, Since My Post Above, No One has replied with any information at all regarding Global.asa so now I am back to post information for anyone else who may be interested in the global.asa file.

It goes in the root directory of your web application (htdocs) and must be named global.asa [;)] If all goes as intended, this file runs automatically on every session start and application restart.
Within this file, you can call Server-Side Sub-Routines which Initialize your Application and Session level variables, as well as destroy them on end.

A sample global.asa file would look like this:

<script language="VBScript" runat="server">

Sub Application_OnStart
Application("SomeVar") = "0"
End Sub

Sub Session_OnStart
Session("SomeOtherVar") = "no"
End Sub

Sub Session_OnEnd
Session("SomeOtherVar") = ""
End Sub

Sub Application_OnEnd
Application("SomeVar") = ""
End Sub
</script>

I hope this was helpful to someone, I know it helps my program start properly each time!! Enjoy!

R. Secord, B.Sc., CTO MorphixTech

bruce
09-05-2003, 10:43 AM
Yes. You'll need to create that file yourself.

Global.asa file can only exists in web application root. Your root directory is already set as root. You can use the web application tool to create more web application.

Hope this helps.


[b]quote:Originally posted by robsecord

I need help with finding the "global.asa" file in my ASP site, if one wasn't provided when registering, do I just create one? And where do I put it? The root of my dir structure is ht_docs i think..

I basically need to create Application and Session level variables and would like to do it in the Application_OnStart and Session_OnStart subs.

Could someone who knows about this pleae help me? I greatly appreciate any advice I could receive on this matter [:D].

R. Secord, B.Sc., CTO MorphixTech
</blockquote id="quote"></font id="quote">