Easy Tutorial
❮ Asp Applications Coll Contents App ❯

ASP MapPath Method



The MapPath method maps the specified path to the corresponding physical path on the server.

Note: This method cannot be used in Session.OnEnd and Application.OnEnd.

Syntax

Parameter Description
path Required. The relative or absolute path to be mapped to a physical path. If the parameter starts with / or \, it returns the full virtual path. If the parameter does not start with / or \, it returns the path relative to the .asp file being processed.

Examples

Example 1

For example, the file test.asp is located at C:\Inetpub\wwwroot\Script.

The file Test.asp (located at C:\Inetpub\wwwroot\Script) contains the following code:

Example 2

How to use a relative path to return the relative physical path to the page being viewed in the browser:


❮ Asp Applications Coll Contents App ❯