UrlPathEncode Method

HttpEncoder.UrlPathEncode Method (String)

.NET Framework (current version)
 

Encodes a subsection of a URL.

Namespace:   System.Web.Util
Assembly:  System.Web (in System.Web.dll)

abstract UrlPathEncode : 
        value:string -> string
override UrlPathEncode : 
        value:string -> string

Parameters

value
Type: System.String

The string to encode.

Return Value

Type: System.String

A URL-encoded string.

The UrlPathEncode method is called by the UrlPathEncode method. The UrlPathEncode method performs the following steps:

  • Applies the encoding logic of the UrlPathEncode method to only the path part of the URL (which excludes the query string). The method assumes that the URL is encoded as a UTF-8 string.

  • Encodes non-spaces so that only a subset of the first 128 ASCII characters is used in the resulting encoded string. Any characters at Unicode value 128 and greater, or 32 and less, are URL-encoded.

  • Encodes spaces as %20.

.NET Framework
Available since 4.0
Return to top
Show:
© 2016 Microsoft