Re: SSI with ASP

by Doug Miles <douglas_miles(at)yahoo.com>

 Date:  Wed, 16 Aug 2000 12:17:08 -0700 (PDT)
 To:  hwg-languages(at)mail.hwg.org
  todo: View Thread, Original
> I remember reading somewhere that you cannot use dynamic values with
> includes in ASP; I think because the includes are processed 
> first, before
> the ASP is processed (or something like that).
> 
That is correct, you cannot have dynamically generated includes.  One
method of getting around this (as long as you aren't including script)
is to use the File System Object:

   Dim TextStream	
   Dim S	
   Dim FSO
   Const OpenFileForReading = 1 
			
   set FSO = Server.CreateObject("Scripting.FileSystemObject")
   S = Server.MapPath("\virtualpath\filename.txt"
   Set TextStream = FSO.OpenTextFile(S, OpenFileForReading)
   sDisp = TextStream.ReadAll 
   TextStream.Close 
   set TextStream = Nothing
   set FSO = Nothing

   response.write sDisp

Be sure to replace the virtual path and file name as appropriate.

Have fun coding!
--Doug


__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA