VirtualPathUtility.Combine Method

Note: This method is new in the .NET Framework version 2.0.

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
)
public static String Combine (
	String basePath, 
	String relativePath
)
public static function Combine (
	basePath : String, 
	relativePath : String
) : String

Parameters

basePath

The base path.

relativePath

The relative path.

Return Value

The combined basePath and relativePath.

Exception typeCondition

HttpException

relativePath is a physical path.

-or-

relativePath includes one or more colons.

ArgumentNullException

relativePath is a null reference (Nothing in Visual Basic) or an empty string.

-or-

basePath is a null reference (Nothing in Visual Basic) or an empty string.

The Combine 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.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: