
Disallowed Parent Paths Error with ASP
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>
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>"-->
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 |
Explore Confluence |
Your Account |
Add Content |
|
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.8 Build:#814 Oct 02, 2007) |