System.Web Namespace HttpRequest Class
Maps the specified virtual path to a physical path.
[ VB ]
Overloads Public Function MapPath ( _
ByVal virtualPath As String, _
ByVal baseVirtualDir As String, _
ByVal allowCrossAppMapping As Boolean _
) As String
[ C# ]
public string MapPath (
string virtualPath,
string baseVirtualDir,
bool allowCrossAppMapping
);
[ C++ ]
public: String* MapPath (
String* virtualPath,
String* baseVirtualDir,
bool allowCrossAppMapping
);
[ JScript ]
public function MapPath (
virtualPath : String,
baseVirtualDir : String,
allowCrossAppMapping : Boolean
) : String;
- virtualPath
- The virtual path ( absolute or relative ) for the current request.
- baseVirtualDir
- The virtual base directory path used for relative resolution.
- allowCrossAppMapping
- If true, the virtualPath may belong to another application.
The physical path on the server.
Exception Type |
Condition |
HttpException |
Occurs when allowCrossAppMapping is false and virtualPath belongs to another application.
or
Attempted to map the path when there is no HttpContext object defined for the request. |
HttpRequest Class HttpRequest.MapPath Overload List