RE: ASP/VBscript question

by "Brett Errington" <brett(at)opensearch.com>

 Date:  Fri, 1 Mar 2002 09:31:29 +0800
 To:  <hwg-techniques(at)hwg.org>
 In-Reply-To:  wednet
  todo: View Thread, Original
Yeah that's correct

Server side processes take place before the ASP code, so you cannot have
conditional loops. There are two ways around this and neither of them
are as nice as what you obviously want:

1. If the includes are not to long, then you could have the includes
processed and still put the conditional asp code around it. This way the
code is included but is not processed. It pretty much works the same way
as you want, but if the includes are big then it could slow your page
down a lot.

2. Use ASP (really vbscripts) filesystem object to determine which file
to open and then print on-screen. This won't allow for extra server-side
code in the include (from memory) but it's suitable if its just html
your including.

Regards,
Brett Errington (Senior User Interface Designer)
brett(at)opensearch.com
Phone: +61 8 9300 9837
Fax : +61 8 9300 9802

http://www.opensearch.com
... leading edge E-business solutions


-----Original Message-----
From: owner-hwg-techniques(at)hwg.org [mailto:owner-hwg-techniques(at)hwg.org]
On Behalf Of Johnson, Mark
Sent: Friday, 1 March 2002 3:51 AM
To: 'hwg-techniques(at)hwg.org'
Subject: ASP/VBscript question

I'm attempting to include a file based on the contents of a variable,
see my
code below.  Ive not been very successful.  It appears that server side
includes are processed and then ASP.  The result is a correct statement,
but
too late for processing.  Suggestions?

<%
response.write "<!--#include virtual=""/documents/scouncil/" & strSchool
&
".txt""-->"
%>

Thanks much!  Mark

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