System.Web.UI.UserControl.MapPath Method

Assigns a virtual file path, either absolute or relative, to a physical file path.

Syntax

public string MapPath (string virtualPath)

Parameters

virtualPath
The virtual file path to map.

Returns

The physical path to the file.

Remarks

While similar to the Page.MapPath(string) method, this method maps the path from the .ascx file's location, not the .aspx file's location. You can use this method to obtain a path to a directory of images or other resources associated with your System.Web.UI.UserControl object.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0