Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include file with parameter ?

Status
Not open for further replies.

lb1

Technical User
Apr 19, 2002
109
0
0
US
I try to use the include file to include a piece of html coding.
The following statement is:

<% HtmFile = &quot;../Catalogs/&quot; & &quot;384&quot; & &quot;.htm&quot; %>
<!--#include file = <%= HtmFile %> -->


If I fill the value for example 384.htm, this work. Is there a way to replace the 381.htm by a variable, and How this can be done.
Thanks
Louis
 
This cannot be achieved with a simple include.
You will have to read the html page like a text file and output its lines to your asp page.
---------------
&quot;We'll never give up, it's no use&quot; (Blink 182)
 
and if you're wondering why, it's cos #includes happen *before* ASP is executed. hence it would actually attempt to include a file called &quot;<%=HtmlFile%>&quot; instead of the value ASP places in the variable HtmlFile.

But thanks for the obvious tip, Byourself - it solved a problem I've been working on for a while! I never even thought to merely read a file instead of including it... --------------------------------------------------
- better than toast.
Penguins - better than --------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top