Complete Server Object Reference
The MapPath method maps a specified path to a physical path.
Note: This method cannot be used in Session.OnEnd and Application.OnEnd.
| Parameter | Description |
|---|---|
| path | Required. A relative or virtual path to map to a physical path. If this parameter starts with / or \, it returns a path as if this parameter is a full virtual path. If this parameter doesn't start with / or \, it returns a path relative to the directory of the .asp file being processed |
For the example below, the file "test.asp" is located in C:\Inetpub\Wwwroot\Script.
The file "test.asp" (located in C:\Inetpub\Wwwroot\Script) contains the following code:
How to use a relative path to return the relative physical path to the page that is being viewed in the browser:
Complete Server Object Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|