- PathType
Specifies the type of the path to FileName. The path type can be one of the following:
Path Type
|
Meaning
|
|---|
File |
The FileName is a relative path from the directory containing the document with the #include directive.
The included file can be in the same directory or in a subdirectory. The included file cannot be in a directory above the page with the #include directive unless you have checked the box for Enable Parent Paths in the property sheet for the Web folder in IIS Manager, or manually set the AspEnableParentPaths metabase property to 1. This is strongly discouraged because it is a security risk. Any Web user could type ../.. as a part of a URL for your site and be shown the contents of parent folders if the parent folders do not have strong ACLs set on them.
IIS 6.0 and later: To increase security, parent paths are disabled by default. This can potentially break upgraded Web sites that use the ..\ notation or include files from parent directories.
|
Virtual |
The file name is a full virtual path from a virtual directory of your Web site.
|
- FileName
Specifies the name of the file to be included. FileName must contain the file name extension, and you must enclose the file name in quotation marks (").
The file containing this directive must use an .asp file name extension, or a file name extension that is mapped to the SSI interpreter; otherwise, the Web server will not process the directive. By default, the file name extensions .stm, .shtm, and .shtml are mapped to the SSI interpreter (ssinc.dll).
The #include directive is the only directive that will work in .asp files as well as .stm, .shtm, and .shtml files.
--- IncExample.asp ---
<!-- The included file is in the same directory as IncExample.asp. -->
<!-- #include file = "myfile.inc" -->
<!-- The included file is in the directory above IncExample.asp.
Enable Parent Paths must be checked for the Web folder. -->
<!-- #include file = "..\myfile.htm" -->
<!-- The included file is in the Scripts virtual directory. -->
<!-- #include virtual = "/scripts/tools/global.inc" -->