473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

nested includes not working as intended

Hello,

I'm working on a new site that has a nearly empty index file (variable
location) that includes a template file (set location) which in turn
includes two data files (variable location dependent on index file's
location). This concept worked in PHP and I'm just playing around with it
in ASP to see if it can make my site management easier because I can't move
to Apache for a while.

It seems that the template file can only include relative to itself and also
with specific paths, but it can't include relative to the original index
file. Is there a graceful way around this?

Simplified code below if it helps...

/index.asp:

<!--#include virtual="/templates/_normal.asp"-->

/templates/_normal.asp:

<!--#include file="./_data.asp"-->

<html>
<head>
<title>title</title>
<link rel="stylesheet" href="/styles/style.css">
</head>
<body>
</body>
</html>

/_data.asp - empty

The above only works if I place _data.asp in the same directory as
_normal.asp. That kinda defeats the purpose though. Ideas?

THANKS!

--
Mike
Jul 19 '05 #1
2 3474
Why not use absolute paths, starting from the root?

--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
"Mike" <so***@sorry.com> wrote in message
news:bg**********@geraldo.cc.utexas.edu...
Hello,

I'm working on a new site that has a nearly empty index file (variable
location) that includes a template file (set location) which in turn
includes two data files (variable location dependent on index file's
location). This concept worked in PHP and I'm just playing around with it
in ASP to see if it can make my site management easier because I can't move to Apache for a while.

It seems that the template file can only include relative to itself and also with specific paths, but it can't include relative to the original index
file. Is there a graceful way around this?

Simplified code below if it helps...

/index.asp:

<!--#include virtual="/templates/_normal.asp"-->

/templates/_normal.asp:

<!--#include file="./_data.asp"-->

<html>
<head>
<title>title</title>
<link rel="stylesheet" href="/styles/style.css">
</head>
<body>
</body>
</html>

/_data.asp - empty

The above only works if I place _data.asp in the same directory as
_normal.asp. That kinda defeats the purpose though. Ideas?

THANKS!

--
Mike

Jul 19 '05 #2
Include paths should be relative to the outtermost file (i.e. the parent
and/or grandparent file).

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Leif Neland | last post by:
PHP Version 4.1.2 Linux (none) 2.4.20-6um #1 SMP Fri Jun 6 10:15:19 EDT 2003 i686 unknown Apache/1.3.26 I run a php-page, which includes include ('/home/pdf/class.ezpdf.php') This then has...
2
by: Alfonso Morra | last post by:
I have a class that contains a nested class. The outer class is called outer, and the nested class is called inner. When I try to compile the following code, I get a number of errors. It is not...
3
by: triplejump24 | last post by:
Hey. Im trying to make program that basically displays all the prime numbers. I need to use bool and for but im not quite sure if i have this right. So far i have this bunch of a mess but can...
5
by: =?Utf-8?B?QUEyZTcyRQ==?= | last post by:
Could someone give me a simple example of nested scope in C#, please? I've searched Google for this but have not come up with anything that makes it clear. I am looking at the ECMA guide and...
3
by: CrazyAtlantaGuy | last post by:
I am working on creating an XSLT that transforms Html into an XML format that can be imported into Framemaker. The challenge, it turns out, is correctly transforming the flat html header tags...
1
by: Matthew Schibler | last post by:
I'm a newbie to Python, with some experience using perl (where I used nested arrays and hashes extensively). I am building a script in python for a MUD I play, and I want to use the shelve module...
0
by: Maric Michaud | last post by:
Le Tuesday 12 August 2008 23:15:23 Calvin Spealman, vous avez écrit : I was not aware of any "nested classes are unsupported" before and didn't consider nested classes as bad practice till...
13
by: Fredrik Lundh | last post by:
Patrol Sun wrote: so why exactly are you trying to nest 20 or 100 for-in loops? </F>
4
by: henry | last post by:
Folks: Using Dreamweaver CS3... Consider a home page, "index.php" which conditionally REQUIREs one of 'N' HTML files of pure content. All site styles are specified in a master CSS file,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.