dynamic #include with IIS 4.0

Results 1 to 2 of 2

Thread: dynamic #include with IIS 4.0

  1. #1
    Join Date
    Dec 1969

    Default dynamic #include with IIS 4.0

    I am trying to include a file based on a querystring that pulls the file name from an Access database. In IIS 5.0, all I need to do is do:<BR><BR>Server.Execute(main)<BR>where "main" is a variable that equals to, let&#039s say news.htm.<BR><BR>But in IIS 4.0, the include command<BR>&#060;!--#include="main"--&#062;<BR>doesn&#039t work because the include command is done first, before we get the value of the variable "main". Is there a workaround under IIS 4.0?

  2. #2
    Join Date
    Dec 1969

    Default RE: dynamic #include with IIS 4.0

    There is not true workaround in IIS 4.0.<BR><BR>*IF* the file you are including contains *NO* ASP, then you<BR>can do this:<BR><BR>&#060;%<BR>includeName = .... &#039 however you get it<BR>Set FSO = Server.CreateObject("Scripting.FileSystemObject")< BR>Set incFile = FSO.OpenTextFile( includeName )<BR>Response.Write incFile.readAll<BR>incFile.Close<BR>Set incFile = nothing<BR>%&#062;<BR><BR>The only other "trick" is to create a custom ASP page<BR>(by creating a new file, perhaps using the session ID<BR>as the file name) and redirect to it. Slow and ugly,<BR>to say the least.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts