|
-
Sep 20th, 2006, 03:09 AM
#1
Thread Starter
Fanatic Member
Global.ASA File Useage
Hi all,
When using the Application object in ASP inserted into the global.ASA file, can you do the following.
1. Can you initialise objects that will be active throughout the session
2. Will they be active throughout the session and destroy when the session timeout, or will you have to design an auto function.
Exampe is as follows.
VB Code:
Sub Application_OnBegin()
Application("Errorpage") = "errorhandling.asp"
Application("restrictAccess") = "accesrestricted.asp"
Application("Visits") = Application("Visits") + 1
End Sub
Sub Session_OnStart()
Session("loggedOn") = False
Session.Timeout = 10
Session.LCID = Getlocale_ID()
Session.CodePage = GetCodePage_ID()
End Sub
Dim Cart_Dict
Cart_Dict = Server.CreateObject("Scripting.Dictionary")
'Do database Connections
End Sub
Sub Session_Onend()
'destroy stuff here
End Sub
Will this be visable or will it kick and scream?
ta all
Kai
As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..
A few things that make a good Developer a Great One.
Methodical and a thorough approach to research and design inevitably leads to success.
Forward thinking is the key to Flow of control.
Never test in the design environment, always test in real time, you get the REAL results.
CBSE & OOSE are the same animal, they just require different techniques, and thinking.
SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
The key to good design is explicit attention to both detail and response.
Think Freely out of the "Box" you're in..... You will soar to better heights.
Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT
-
Sep 21st, 2006, 08:55 AM
#2
Re: Global.ASA File Useage
They'll be set to nothing once the session is over. But the Application variables stay for the lifetime of the application (or until the server is reset or rebooted).
-
Sep 22nd, 2006, 04:28 AM
#3
Thread Starter
Fanatic Member
Re: Global.ASA File Useage
Cheers mend,
So any code will be initiated upon the start of the session or application such as objects and such code.
Ok another question is, if I use the application object, is it instantiated automotaically upon a session start, or is there a specific execute command that i am to use. Never used a global file as never needed it, but this particular project has grown in size to such that I do need one, and the best way is the application object.
Have all the info on this, but jsut need a bith of a mop up session to clarify.
Cheers mate
kai
As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..
A few things that make a good Developer a Great One.
Methodical and a thorough approach to research and design inevitably leads to success.
Forward thinking is the key to Flow of control.
Never test in the design environment, always test in real time, you get the REAL results.
CBSE & OOSE are the same animal, they just require different techniques, and thinking.
SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
The key to good design is explicit attention to both detail and response.
Think Freely out of the "Box" you're in..... You will soar to better heights.
Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT
-
Sep 25th, 2006, 08:39 AM
#4
Re: Global.ASA File Useage
Application variables are instantiated the very first time that the application is accessed. You upload your site to the live web server, a visitor from Russia visits it. The application variable has now been initialized and is available to all visitors after that regardless. That's why it's called the application variable, it's lifespan is the lifespan of the application itself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|