Global.asa Reference (i)

Source: Internet
Author: User
The reference Global.asa file is an optional file in which users can specify event scripts and declare objects that have session and application scopes. The contents of the file
Displayed to the user, but is used to store event information and objects that are used globally by the application. The name of the file must be global.asa and must be stored in the application's
The root directory. There can be only one Global.asa file per application.

The Global.asa file can only contain the following:

1. Application Events

2. Session Events

3.<object> statement

TypeLibrary statement
If the included script is not encapsulated with a <SCRIPT> tag, or the defined object has no session or application scope, the server returns an error. The server ignores the marked
Scripts that are recorded but not used by application or session events, and HTML statements in the file.

Scripts contained in Global.asa files can be written in any language that supports scripting. If multiple events use the same scripting language, they can be organized into a set of
<SCRIPT> tags.

When the user saves changes to the Global.asa file, the server finishes processing all the current applications before recompiling the Global.asa file
Please. During this time, the server rejects the other request and returns an error message stating that the application is rebooting and cannot process the request.

When all the user's current requests are processed, the server invokes the Session_OnEnd event for each session, deletes all active sessions, and calls
The Application_OnEnd event closes the application and then compiles the Global.asa file. Next, the user's request launches the application and creates a new session that touches
Hair Application_OnStart and Session_OnStart events.

However, saving changes to the files contained in the Global.asa file does not cause the server to recompile global.asa. In order for the server to identify changes to the containing file,
You must save the Global.asa file again.

A procedure declared in a Global.asa file can only be from one or more of the Application_OnStart, Application_OnEnd, Session_OnStart, and
Session_OnEnd event-related scripts are called. They are not available in ASP pages in an ASP-based application.

To share procedures between applications, you can declare them in a separate file and then use a server-side include (SSI) statement to include the file in the call to the procedure
ASP page. Typically, an extension of the containing file should be. Inc.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.