Disabling parent paths in IIS when using Server.MapPath

The Server.MapPath command is described in another tutorial. Sometimes a server administrator will want to limit what information can be found by running Server.MapPath on a particular web site and they might want to hide path information in the rest of the server. This is done by disabling parent paths in IIS

Parent paths in IIS

To change the IIS setting which allows or disallows the use of parent paths, go into IIS Properties, select "Home directory" and click the button marked "Configuration" and then the tab marked "App Options". This tab is shown below.

Changing parent path permission in IIS

By default, parent paths are enabled but the check box can be cleared to prevent their use.

Notes:

The sample code in these tutorials is written for VBScript in classic ASP unless otherwise stated. The code samples can be freely copied.