VirtualPathUtility.Combine Method (String, String)

 

Combines a base path and a relative path.

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

public static string Combine(
	string basePath,
	string relativePath
)

Parameters

basePath
Type: System.String

The base path.

relativePath
Type: System.String

The relative path.

Return Value

Type: System.String

The combined basePath and relativePath.

Exception Condition
HttpException

relativePath is a physical path.

-or-

relativePath includes one or more colons.

ArgumentNullException

relativePath is null or an empty string.

-or-

basePath is null or an empty string.

TheCombine method returns the value of the AppDomainAppVirtualPath property if the relative path is exactly a tilde (~).

The Combine method uses the AppDomainAppVirtualPath property value rather than the base path, if the relative path starts with a tilde and a slash mark (~/); otherwise, the Combine method uses the base path.

.NET Framework
Available since 2.0
Return to top
Show: