No Script in Include Directives
Written by Eric Smith, Northstar Computer Systems LLC
Because of the way ASP processes include and other server-side include directives, you can't have any script in your actual directives. The directives are processed before the ASP code begins running, so you can't do this:
<% Const Filename = "test.asp" %>
<!--#include file="<% = Filename %>" -->
This will cause an error. When laying out your include files, remember that the file contents will be inserted before any code runs. This means that you should wrap any ASP code in the include files separately and not count on the file being included within ASP delimiters. Normally, the best place to do include files is at the top of the file, so that you can include the Option Explicit directive in a common include file and not have to worry about forgetting it later.
Keywords: [
Uncategorized ASP Tips
]
Publication Date: 8/1/1999
|