SPHttpUtility.UrlPathEncode method (String, Boolean, Boolean, Boolean)
Encodes path portion of an URL for reliable HTTP transmission from the Web server to a client.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Shared Function UrlPathEncode ( _
urlToEncode As String, _
allowHashParameter As Boolean, _
encodeUnicodeCharacters As Boolean, _
rfcCompliant As Boolean _
) As String
'Usage
Dim urlToEncode As String
Dim allowHashParameter As Boolean
Dim encodeUnicodeCharacters As Boolean
Dim rfcCompliant As Boolean
Dim returnValue As String
returnValue = SPHttpUtility.UrlPathEncode(urlToEncode, _
allowHashParameter, encodeUnicodeCharacters, _
rfcCompliant)
public static string UrlPathEncode(
string urlToEncode,
bool allowHashParameter,
bool encodeUnicodeCharacters,
bool rfcCompliant
)
Parameters
urlToEncode
Type: System.StringThe URL to encode.
allowHashParameter
Type: System.Booleantrue to allow hash paramter; otherwise, false.
- encodeUnicodeCharacters
Type: System.Boolean
rfcCompliant
Type: System.BooleanMake the URL encoding compliant with RFC 3986? Set it to True except for legacy code compatibility.
Return value
Type: System.String
The encoded URL. Empty if the urlToEncode parameter is empty and null if the urlToEncode parameter is null.