VirtualPathUtility.Combine Method

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
Not applicable.

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 Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: