Solved

Including with ASP

Posted on 1998-12-28
2
135 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
Comment Utility
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
Comment Utility
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 to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now