Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Jun 10, 1999

Dynamic Includes

Question:
How can I do a dynamic include, such as:

However, I think I know why this doesn't work-- because includes are tossed in before it goes to the parser (asp.dll). But if that's the case, why is it? I seem to have tried every possible combination trying to get this to work, to no avail.

Answer:
You are right: it can't be done. But there is a workaround, if you can live with it. Simply use a large Select Case statement:
<% Select Case varfilename Case "value1" %> <% Case "value2" %> <%
... and so on ...
%> <% End Select %>
Be very careful about placing the <% and %> tags, though.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date