: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR
OWN RISK. Microsoft provides this code "as is" without warranty of any
kind, either express or implied, including but not limited to the implied
warranties of merchantability and/or fitness for a particular purpose.
Previous versions of IIS allowed an ASP page to include the
contents of another file using code similar to the following:
attribute as an alternative method to
include another page. The new syntax may then look similar to the
following:
All code in the included page appears to the scripting engine as
though it were between the
tags. Therefore, unlike the
directive, your included page should consist of raw code only.
For example, consider the following #include statement:
<!--#include file="file.inc"-->
This statement would need to include a page similar to the
following:
<%
For X = 1 To 5
Response.Write "<p>Howdy!</p>"
Next
%>
Now consider the following
<SCRIPT> statement:
<SCRIPT LANGUAGE="VBScript" RUNAT="SERVER"
SRC="file.inc"></SCRIPT>
This page would need to include a page similar to the following:
For X = 1 To 5
Response.Write "<p>Howdy!</p>"
Next
The
<SCRIPT> example is treated by ASP as though the
parent page contains the following syntax:
<SCRIPT LANGUAGE="VBScript" RUNAT="SERVER" SRC="file.inc">
For X = 1 To 5
Response.Write "<p>Howdy!</p>"
Next
</SCRIPT>
Note: No actual code should placed between the
<SCRIPT> and
</SCRIPT> tags in the
parent page, as it will be ignored.
attribute can use either relative or virtual paths,
as shown in the following table:
The following ASP code demonstrates how to use the new
<SCRIPT> syntax to mix server-side and client-side
scripting.