Solved

Asp Include file from Parent directory

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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:

706 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

20 Experts available now in Live!

Get 1:1 Help Now