Learnthat.com Free Certification and Computer Online Courses
ThatNetwork.com Internet Media Network Givethat.com free gift ideas Definethat.com - Free technical definitions, define Free Romance Tips, Romantic Tips, Date Ideas Free POD publisher comparison print on demand
Learnthat.com Free A+ Certification, Computer Classes, Certification Courses, Business, Lifestyle, ApplicationsFree business tutorials and definitionsFree certification tutorials and definitionsFree computer and technical tutorials and technical definitionsFree Finance Tutorials and DefinitionsFree House Repair TutorialsFree Lifestyle and Fun Tutorials
  All Online CoursesNew Courses QuickTipsWord DefinitionsSubmit a TutorialLinks
÷ Resources
Home
free tech tutorials
Free Tutorials
free tech tutorials
Certifications
free tech tutorials
Definitions
free tech tutorials
Resources/Links
free tech tutorials
Forums
free tech tutorials
Distance Education
free tech tutorials
Highest Rated Tutorials
÷ Popular Tutorials
÷ New Tutorials

Active Server Pages (ASP)

 

Working with ASP Applications

The Global.asa File

The Global.asa file stores the subroutines that are processed when an ASP application starts and ends. It is often used to declare variables and create objects such as database connections. The file is not required to run an application, but including it prevents you from having to include the same code on each page in your application.

Code in the Global.asa file is not displayed, so the contents of the file should be limited to tasks required by the application to run. Note, too, that you cannot call subroutines contained in the Global.asa file from elsewhere in the application.

You can create the file using a text editor. It should be given the file name Global.asa and saved in the root directory of the application. When an application starts, the server will look for and run this file first.

Working with Subroutines

All the code to be processed in the Global.asa file must be contained in one of four predefined subroutines: Application_OnStart, Application_OnEnd, Session_OnStart and Session_OnEnd. The Application_OnStart and Application_OnEnd subroutines let you perform tasks that will be processed when the application starts (for example, declaring variables) and ends (for example, removing variables). Similarly, the Session_OnStart and Session_OnEnd subroutines let you perform tasks to be processed at the start and end of sessions.

You can, however, create your own subroutines, as long as they are called from within one of the four predefined subroutines.

Subroutines should be enclosed in the <SCRIPT> </SCRIPT> tags. The RUNAT attribute specifies that the script should be run on the server.

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart

Application("AppName")="Holiday Tips "

Application("Holiday")="Valentine's Day"

End Sub

Sub Application_OnEnd

Application("Holiday")=""

End Sub

</SCRIPT>

 

 

by Summer Doucet

Find more free Internet tutorials from Learnthat.com.

More Information:

Help us by rating this tutorial: [---] [--] [+] [++] [+++]
[---] lowest; [+++] highest

 

 

 


Learn: Free Tutorials - Links to Free Tutorials
Understand: Free Technical Definitions - ExplainThat Whitepapers
Use: Certification Section - Discussion Forum

Visit Our Network Sites:

DefineThat.com Technical Defintions Romancetips.com
Free Gift Ideas - GiveThat Planthat.com Free Unique Business Ideas
PublishOnDemand.net - Learn about Print on Demand (POD) - Self Publishing Seekthat.com - Technical Search Engine
ThatNetwork.com  

About Us : Contact Us : Advertise : Privacy Information

© 1998-2004 Learnthat.com