The #include directive instructs the Web server to insert the contents of a file into an HTML page. The included file can contain any content that is valid within an HTML document. You must surround a directive with HTML comment delimiters.
This directive can be used in both ASP pages and HTML pages.
<!-- #include PathType = FileName -->
PathType
Specifies the type of the path to FileName. The path type can be one of the following:
Path Type | Meaning |
---|---|
File | The file name 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; it cannot be in a directory above the page with the #include directive. |
Virtual | The file name is a full virtual path from a virtual directory in 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 the #include directives must use a file name extension that is mapped to the SSI interpreter; otherwise, the Web server will not process the directives. By default, the extensions .stm, .shtm, and .shtml are mapped to the interpreter (Ssinc.dll). If you have Internet Service Manager installed, you can modify the default extension mappings and add new mappings; see Setting Application Mappings. Included files can have any file name extension, but a recommended practice is to give them the .inc extension.
<!-- The included file is in the same directory as the parent file. --> <!-- #include file = "myfile.inc" --> <!-- The included file is in the Scripts virtual directory. --> <!-- #include virtual = "/scripts/tools/global.inc" -->