Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Including with ASP

Posted on 1998-12-28
2
Medium Priority
?
142 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
MasseyM earned 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

722 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