Name
#include
Synopsis
<!-- #includePathType= "strFileName" -->
The
#include Server-Side Include allows you to insert
the contents of a given file into the HTML content or ASP script. You
must surround the #include Server-Side Include
statement in an HMTL comment. Otherwise, the text of the Server-Side
Include will be displayed as straight text.
Parameters
-
PathType The type of path specified in the
strFileNameparameter. The possible values forPathTypeare described in the following table:
|
PathType Value |
Description |
|---|---|
|
|
Treats the value of the |
|
|
Treats the value of the |
-
strFileName The
strFileNameparameter represents the name of the file whose contents you want inserted into the HTML content.
Introduced with IIS 5.0, there is a second way to include a file. You
can use the <SCRIPT> tag combined with the
SRC attrribute using the following format:
<SCRIPT LANGUAGE = "VBScript" RUNAT=SERVER SRC="strFileName">
</SCRIPT>In the preceding code, the strFileName
parameter is the same as that used with the INCLUDE directive and can
be an absolute or relative path.
Example 1
The following script contains only a simple "back to top" line of code and a horizontal line with a graphic.
<!--ReturnTop.INC --> <CENTER> <HR> Click <A HREF = #top>here</A> to go back to the top of the page.<BR> <IMG SRC = "/Images/CorpLogo.GIF"></CENTER><BR>
We could now include this file anywhere ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access