Dashboard > Shared Web Hosting > ... > ASP & ASP.NET > Disallowed Parent Paths Error with ASP

View Info

Disallowed Parent Paths Error with 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 because parent paths are 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 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 example below illustrates how to implement virtual paths:

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


Browse Space
- Pages
- Labels
- Attachments
- Mail
- News
- Activity
- Advanced

Explore Confluence
- Popular Labels
- Notation Guide

Your Account
Log In

 

Other Features

View a printable version of the current page.

Add Content


Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.8 Build:#814 Oct 02, 2007)
Bug/feature request - Contact Administrators