Monday, March 22, 2010

Tips and Notes In the sections above we have used the file extension ".inc" for included files

. Notice that if a user tries to browse an INC file directly, its content will be displayed. If your included file contains confidential information or information you do not want any users to see, it is better to use an ASP extension. The source code in an ASP file will not be visible after the interpretation. An included file can also include other files, and one ASP file can include the same file more than once. Important: Included files are processed and inserted before the scripts are executed. The following script will NOT work because ASP executes the #include directive before it assigns a value to the variable: <% fname="header.inc" %> You cannot open or close a script delimiter in an INC file. The following script will NOT work: <% For i = 1 To n Next %> But this script will work: <% For i = 1 to n %> <% Next %> 11.ASP The Global.asa file The Global.asa file The Global.asa file is an optional file that can contain declarations of objects, variables, and methods that can be accessed by every page in an ASP application. All valid browser scripts (JavaScript, VBScript, JScript, PerlScript, etc.) can be used within Global.asa. The Global.asa file can contain only the following: • Application events • Session events • declarations • TypeLibrary declarations • the #include directive Note: The Global.asa file must be stored in the root directory of the ASP application, and each application can only have one Global.asa file.