Export (0) Print
Expand All

VirtualPathProvider.CombineVirtualPaths Method

Combines a base path with a relative path to return a complete path to a virtual resource.

Namespace:  System.Web.Hosting
Assembly:  System.Web (in System.Web.dll)

public virtual string CombineVirtualPaths(
	string basePath,
	string relativePath
)

Parameters

basePath
Type: System.String

The base path for the application.

relativePath
Type: System.String

The path to the virtual resource, relative to the base path.

Return Value

Type: System.String
The complete path to a virtual resource.

Use the CombineVirtualPaths method to inspect the contents of a relative path to a virtual resource and perform any modifications required.

The default implementation combines the basePath and relativePath parameters according to standard ASP.NET path processing.

Notes to Inheritors

If you override the default implementation of the CombineVirtualPaths method, you are required to convert any special syntax with the relativePath parameter to a valid virtual path. You are responsible for syntax checking, path validation, and handling malformed input, as well as edge cases for well-formed input.

In most cases it will not be necessary to override the default CombineVirtualPaths method. However, if you do need to modify the path, we recommend that you limit your CombineVirtualPaths implementation to modifying tokens specific to your virtual path provider in the relativeUrl parameter, and that you then call the base implementation to perform normal ASP.NET path processing

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft