Solved

Including with ASP

Posted on 1998-12-28
2
138 Views
Last Modified: 2013-12-25
I need to build a html-page by putting it together from three diffrent pages. Also, when I call the pages, I must be able to use a varialbe.

To include files I know I can use:
<!-- #include file ="G:\xxxx\xxxx.inc" -->

but what should I do if I want to something like this:
<!-- #include file = "G:\xxx\<%=variable%>\xxxx.asp -->

0
Comment
Question by:MHQ
2 Comments
 
LVL 10

Accepted Solution

by:
MasseyM earned 200 total points
ID: 1857477
To use the include files, you have to know the path before hand, so you cannot include it with the vairale.  But, you could do something like this. Include a file called g:\xxx\redir.asp and within that file, get the variable and then rdirect to the appropriate page.  That is theonly way that I see that will work.
0
 
LVL 1

Expert Comment

by:rajgn
ID: 1857478
Another solution could be the conditional Include.
Write a If...else or switch and check for various values of the variable and write the include accordingly. like this...

<% if var = "var1" then %>
<!-- #INCLUDE file="var1.inc"-->
<% elseif var = "var2" then %>
<!-- #INCLUDE file="var2.inc"-->
<% elseif var = "var2" then %>
<!-- #INCLUDE file="var3.inc"-->
<% else %>
<!-- #INCLUDE file="nothing.inc"-->
<% end if %>

0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question