Active Server Pages error ASP 0131 or Server.MapPath() error 'ASP 0175 : 80004005'

SYMPTOMS:
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>

or

Server.MapPath() error 'ASP 0175 : 80004005'

CAUSE :
This is caused by disabling ASP's "parent paths" for a Web site or application while using relative parent paths in an include statement.

Relative parent paths in include statements use the following form:

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

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>"-->

 


The Enable Parent Paths setting has been disabled from IIS since it is a security hazard, and recommended to be turned off by Microsoft.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

ASP.NET Test Page

You can use the following code in a test.aspx file to check and see if asp.net is working on your...