Solved

Asp Include file from Parent directory

Posted on 2006-06-16
2
597 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
[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 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to count occurrences of each item in an array.

729 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