dynamic includes of asp code

G

Gary Contois

I have seen the discussion below of how to use dynamic
includes to get the info into the page. This is very
helpful but does not quite fit my issue.

I am currently using an include to pull in a file
containing user defined variables in vbscript. I pull
these into the page which lets the user set certain
variables without touching the ASP.

I now want to dynamically include this user defined page
but ran into the problem listed below.

Can anyone think of a way I can get around this problem.

Thanks,
Gary
 
G

Gary Contois

The problem listed in the previous messages that you
cannot use a dynamic include since it is preprocessed.
 
R

Ray at

What is it you're trying do then? ARe you trying to do something like (if
this would work, anyway)

<%

Select Case sUsername
Case "Ray" %>
<!-- #include file="personalvars/ray.inc" -->
<% Case "Gary" %>
<!-- #include file="personalvars/ray.inc" -->
<% ''etc.
End Select
%>

Ray at work
 
E

Evertjan.

What is it you're trying do then? ARe you trying to do something like
(if this would work, anyway)

<%

Select Case sUsername
Case "Ray" %>
<!-- #include file="personalvars/ray.inc" -->
<% Case "Gary" %>
<!-- #include file="personalvars/GARY.inc" -->
<% ''etc.
End Select
%>

It will certainly work, but do not be surprised if a code in the "unused"
include file crashes the page.

If the sUsername = "Ray",
having an extra "End Select" statement in GARY.inc will probably do so.

The to be used and the not to be used file are both loaded and become part
of the code to be rendered.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top