Solved

Asp Include file from Parent directory

Posted on 2006-06-16
2
562 Views
Last Modified: 2013-11-18
Active Server Pages error 'ASP 0131'

Disallowed Parent Path

/www/folder/home.asp, line 2

The Include file '../index.asp' cannot contain '..' to indicate the parent directory.

******************************
I have been using information from : http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_10354572.html?query=asp+include+a+file+in+parent+directory&clearTAFilter=true 

I am trying to get a file from the parent directory to include. Can anyone tell me why it is working for some people and not me?

<!--#include file="../index.asp"-->
0
Comment
Question by:cipiWeb
2 Comments
 
LVL 23

Accepted Solution

by:
basicinstinct earned 150 total points
ID: 16919250
From here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q226474

RESOLUTION
The best solution to the problem is to use absolute virtual paths from the root of the Web site instead of relative paths.

For example, if you use an include file named "mycode.inc" at the root of your server, the virtual path would be "/mycode.inc." If you use the same include file in a virtual directory named "/includes" on your server, the virtual path would be "/includes/mycode.inc."

The syntax example below illustrates how to implement virtual paths:

<!--#include virtual="/<virtual path>/<filename.ext>"-->
                              

An alternative to using absolute virtual paths is to enable parent paths; however, this is not the preferred method. (See the notes in the More Information section for details.) This is accomplished for your default Web site by using the following steps:
1.      Open the Internet Services Manager in the Microsoft Management Console (MMC).
2.      Right-click on your Default Web Site and select Properties.
3.      Click the Home Directory tab.
4.      Click the Configuration button.
5.      Click the App Options tab.
6.      Click to select the Enable Parent Paths checkbox.
7.      Click the OK button until you return to the MMC.
0
 

Author Comment

by:cipiWeb
ID: 16919459
Awesome, it works. (ended up turning on parent paths.) but I would still like to make sure I understand the virtual includes, mainly... how do they differ from file?

This is a wild guess, but does file work relative to the file with the include script and virtual works relative to the domain root?

What is the difference between a virtual directory and a real directory? ( Folder )
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

867 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

16 Experts available now in Live!

Get 1:1 Help Now