System.Web.VirtualPathUtility.IsAppRelative Method

Returns a Boolean value indicating whether the specified virtual path is relative to the application.

Syntax

public static bool IsAppRelative (string virtualPath)

Parameters

virtualPath
The virtual path to check.

Returns

true if virtualPath is relative to the application; otherwise, false.

Remarks

The virtual path can be just the root operator (the tilde [~]), or it can begin with the root operator. If virtualPath is null, an ArgumentNullException exception is raised. If virtualPath is an empty string (""), the VirtualPathUtility.IsAppRelative(string) method returns false.

Note:

"~filename" is not a valid virtual path and returns false for the VirtualPathUtility.IsAppRelative(string) method.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0