Short answer: You don't.
Long answer: This is off topic for the Cold Fusion list, so feel free to
email me off list about it. That said...
ASP doesn't allow dynamic includes. The correct work-around depends on what
you want to do. From your example, it looks like you're trying to include
headers. You could build the header as an .asp file which will be parsed,
and then could be dynamic itself, to display the proper graphics/text based
on script variables, server variables, cookies, etc.
Even if you created 2 or 3 separate headers, and built their include code
into a select case or if statement, ASP includes ALL the files, regardless
of the code around them, before compiling the code... so even though your
logic dictates that only one should be included, depending on the case/if
statement, all of them will be included anyway.
That's one of the reasons I like CF. :)
Jonathan
-----Original Message-----
From: Eric Dawson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 11, 2000 12:53 PM
To: [EMAIL PROTECTED]
Subject: (OT) Feel like a dumbass
An included file can, in turn, include other files. An .asp file can also
include the same file more than once, provided that the <INCLUDE> statements
do not cause a loop. For example, if the file First.asp includes the file
Second.inc, Second.inc must not in turn include First.asp. Nor can a file
include itself. ASP detects such loop or nesting errors, generates an error
message, and stops processing the requested .asp file.
ASP includes files before executing script commands. Therefore, you cannot
use a script command to build the name of an included file. For example, the
following script would not open the file Header1.inc because ASP attempts to
execute the #Include directive before it assigns a file name to the variable
name.
<!-- This script will fail -->
<% name=(header1 & ".inc") %>
<!--#include file="<%= name %>"-->
===
okay. then how do you do it?
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.