Response.Write and Include statements?

Results 1 to 2 of 2

Thread: Response.Write and Include statements?

  1. #1
    Join Date
    Dec 1969

    Default Response.Write and Include statements?

    Hi all!<BR><BR>I have a project that I am working on. In order to test it, we have on our web server, off wwwroot, and application folder and a development folder.<BR><BR>I am using the Include Virtual command in my asp pages. It works well enough, but, I am always having to change the paths in those include statements when one of the pages gets tested and moved to the application folder.<BR><BR>So, I would to, if possible, use a variable to store the path (and, therefore, I only have to change one path statement) and Response.Write. So, here is what I have done:<BR><BR>Dim strIncludePath<BR><BR>strIncludePath="applications/search/common/"<BR> <BR>Response.Write "&#060;!--#include virtual=" & strIncludePath & "myincludefile.asp--&#062;"<BR><BR>As you might have already guessed, this does not work. When I view the source of the ASP file in my browser, it shows:<BR><BR>&#060;!--#include virtual=applications/search/common/myincludefile.asp--&#062;<BR><BR>So, the include file is obviously not being processed.<BR><BR>My question, therefore, is can this be done? And, if so, what is the proper syntax?<BR><BR>Thank you very much!<BR>Heather

  2. #2
    Join Date
    Dec 1969

    Default RE: Response.Write and Include statements?

    its not possible. you can&#039;t do use include files dynamically. the way iis works, is that it first searches for the include file. adds it to the current file. then it processes the script.

Posting Permissions

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