Lounge Network - Knowledge Base

  View Printer Friendly Version Search
KNOWLEDGE BASE HOME » 15. INFORMATION: SCRIPT AND PROGRAMMING QUESTIONS Viewing Answer
I get a Disallowed Parent Paths Error, when using ASP?
Issue

When you use relative paths in include statements with Microsoft's Active Server Pages (ASP), browsing a Web page may return an error message similar to the following:

Active Server Pages, ASP 0131
Disallowed Parent Path
The Include file '../<filename.ext>' cannot contain '..' to indicate the parent directory.
/<path>/<filename.ext>, line <number>



Cause

This error occurs due to parent paths being disabled for the website or application and relative parent paths are used in include statements, as the example shows below:
<!--#include file="../<filename.ext>"-->



Solution

The solution 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 "yourcode.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/yourcode.inc."

The example below illustrates how to implement virtual paths:

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

KNOWLEDGE BASE HOME » 15. INFORMATION: SCRIPT AND PROGRAMMING QUESTIONS Viewing Answer




Knowledgebase Manager

© Copyright Lounge Network 2001-2017