SPUrlUtility.IsProtocolAllowed method (String, Boolean)

Gets a Boolean value indicating whether the specified URL uses a supported protocol.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Shared Function IsProtocolAllowed ( _
    fullOrRelativeUrl As String, _
    allowRelativeUrl As Boolean _
) As Boolean
'Usage
Dim fullOrRelativeUrl As String
Dim allowRelativeUrl As Boolean
Dim returnValue As Boolean

returnValue = SPUrlUtility.IsProtocolAllowed(fullOrRelativeUrl, _
    allowRelativeUrl)
public static bool IsProtocolAllowed(
    string fullOrRelativeUrl,
    bool allowRelativeUrl
)

Parameters

  • fullOrRelativeUrl
    Type: System.String

    A string that contains the full or relative URL.

  • allowRelativeUrl
    Type: System.Boolean

    true to allow a relative URL as the fullOrRelativeUrl parameter; otherwise, false.

Return value

Type: System.Boolean
true if the URL uses a supported protocol; otherwise, false.

Remarks

To return an array of allowed protocols, use the AllowedProtocols property.

See also

Reference

SPUrlUtility class

SPUrlUtility members

IsProtocolAllowed overload

Microsoft.SharePoint.Utilities namespace