It's often a good idea to collect commonly used functions into one file and include that file in all pages that require those functions.
The included file can contain plain text, declare functions and subroutines with <SCRIPT> tags, or define variables and constants. To include the file, use a server-side #include directive at the top of your file. Here is an example:
<!-- #include virtual="/MyRoot/include/funclib.inc" -->
Included files are usually named with the .inc extension. Although this differentiates the file, it can pose a security threat if you have directory browsing enabled. The .inc extension is not normally script-mapped by Internet Information Server, and most browsers don't recognize it, so anyone who knows where to find the files can download and open them. You can prevent this from happening by either associating the .inc extension with Asp.dll in the script map (use the App Mappings tab of the Application Configuration dialog box) or by storing the included files in their own subdirectory and disallowing directory browsing and read access.
The entire text of the include file is incorporated into the ASP source file at the point where the #include statement appears. Although there is technically no limit to the number of files you can include, each one adds to the size of the compiled ASP file—it's better to only include files that you know you will need.
Since all include files are processed before the script executes, you cannot dynamically decide which file to include. Also, you cannot use the #include directive in global.asa.