Writing out VBS code with response.write()
As stated in another reply, include files are processed before any others
and you cannot do includes like what you are suggesting or conditional
includes. If you are using Win2000 and IIS5, you do have a way to work
around this built into Active Server Pages. The way that Microsoft has
provided to do what you are asking about is the Execute method of the Server
object. The Execute method transfers control to the specified script and
then returns to the current script after running the code in the other
script. With this method, your code would look like this:
Do Until objrecordset.EOF
If objrecordset.Fields("pluginInclude") <> "" Then
Server.Execute(objrecordset.Fields("pluginInclude")
objrecordset.MoveNext
Loop
--
=========================
Kyle M. Burns, MCSD, MCT
Quote:
> I have a list of VBS include files in a database field and want to
programatically include them into an asp page like so:
Quote:
> <pre>
> <%
> objrecordset.source="SELECT * FROM plugins WHERE 1=1"
> objrecordset.open
> while not objrecordset.EOF
> if objrecordset.fields("pluginInclude")<>"" then
response.write("<%<!--include file=""" &
objrecordset.fields("pluginInclude") & """-->%>")
Quote:
> objrecordset.movenext
> wend
> objrecordset.close
> </pre>
> This however doesn''t work, as it''s writing the <!--#include
file="xyu.inc"--> line to the HTML.. How else can I do this?
Quote:
> -----------------------------
> This message is posted by http://asp.forumszone.com