RE: SSI with ASP
by "Todd Philipps" <todd(at)anvil-group.com>
|
Date: |
Wed, 16 Aug 2000 10:27:26 -0700 |
To: |
"'Jeff Pearson'" <dalamar(at)golden.net>, "'HWG Languages'" <hwg-languages(at)mail.hwg.org> |
In-Reply-To: |
golden |
|
todo: View
Thread,
Original
|
|
your problem is that the ASP server pulls the files specified in the
#includes before it determines what the values in the <%= ... %> are. So it
is trying to find the file specified in the #include virtual="..."
statement.
Suggestion #1:
Try the FileSystemObject to read the txt file and write it out.
sFileName = Request.QueryString("id") & ".txt"
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(sFilename, 1,TristateFalse)
sLine = a.ReadAll
Response.Write sLine
a.close
Set fs=Nothing
Good luck,
Todd Philipps
the Anvil Group
-----Original Message-----
From: owner-hwg-languages(at)hwg.org [mailto:owner-hwg-languages(at)hwg.org]On
Behalf Of Jeff Pearson
Sent: Wednesday, August 16, 2000 9:48 AM
To: HWG Languages
Subject: SSI with ASP
Hello,
I have a question about using Server Side Includes in a dynamic page
with ASP. I have to display a "detail page" with advertiser contact
information including an image and a text description not in a database.
I can get the image to display fine (not using SSI as there is no need)
but how do I display the appropriate external text file with SSI? I have
tried virtual include and file include both using dynamic values:
<!--#include virtual="<% Request.QueryString("id") %>.txt"-->
<!--#include
virtual="<%=(rsAdvertiserDetail.Fields.Item("phone'").Value)%>.txt"-->
(The 'id' parameter contains the same value as the "phone" parameter.)
It always returns with the same error that the include file cannot be
found. As soon as it sees the next quote it thinks that is what its
looking for.
the include file'
<%=(rsAdvertiserDetail.Fields.Item(
'cannot be found
Is there another way, or will I have to place the text into the
database?
Anyone ever run into this?
Jeff Pearson
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA