VirtualPathUtility::IsAbsolute Method (String^)
.NET Framework (current version)
Returns a Boolean value indicating whether the specified virtual path is absolute; that is, it starts with a literal slash mark (/).
Assembly: System.Web (in System.Web.dll)
Parameters
- virtualPath
-
Type:
System::String^
The virtual path to check.
Return Value
Type: System::Booleantrue if virtualPath is an absolute path and is not null or an empty string (""); otherwise, false.
| Exception | Condition |
|---|---|
| ArgumentNullException | virtualPath is null. |
A virtual path is absolute if it begins with a literal slash mark (/). For example, the Path property returns an absolute virtual path.
The following code example demonstrates how to use the IsAbsolute, IsAppRelative, and ToAppRelative methods.
.NET Framework
Available since 2.0
Available since 2.0
Show: