Modifier

Partager via


VirtualPathProvider.CombineVirtualPaths(String, String) Method

Definition

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

public:
 virtual System::String ^ CombineVirtualPaths(System::String ^ basePath, System::String ^ relativePath);
public virtual string CombineVirtualPaths (string basePath, string relativePath);
abstract member CombineVirtualPaths : string * string -> string
override this.CombineVirtualPaths : string * string -> string
Public Overridable Function CombineVirtualPaths (basePath As String, relativePath As String) As String

Parameters

basePath
String

The base path for the application.

relativePath
String

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

Returns

The complete path to a virtual resource.

Remarks

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(String, String) 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(String, String) method. However, if you do need to modify the path, we recommend that you limit your CombineVirtualPaths(String, String) 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

Applies to