SPHttpUtility.UrlPathEncode Method (String, Boolean, Boolean)
Encodes the specified path part of a URL for HTTP transmission.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Function UrlPathEncode ( _
urlToEncode As String, _
allowHashParameter As Boolean, _
encodeUnicodeCharacters As Boolean _
) As String
'Usage
Dim urlToEncode As String
Dim allowHashParameter As Boolean
Dim encodeUnicodeCharacters As Boolean
Dim returnValue As String
returnValue = SPHttpUtility.UrlPathEncode(urlToEncode, _
allowHashParameter, encodeUnicodeCharacters)
public static string UrlPathEncode(
string urlToEncode,
bool allowHashParameter,
bool encodeUnicodeCharacters
)
Parameters
urlToEncode
Type: System.StringA string that contains the path.
allowHashParameter
Type: System.Booleantrue to specify that the decode operation can include a hash parameter; otherwise, false.
encodeUnicodeCharacters
Type: System.Booleantrue to encode Unicode characters; otherwise, false.
Return Value
Type: System.String
A string that contains the encoded path.