Solved

Including with ASP

Posted on 1998-12-28
2
137 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I need help embedding Base64 Images using VB.Net - When image is a .jpg 2 57
Remove lines by logo 2 29
hosting images 4 27
Wordpress plugins not working in html 3 21
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 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