Encodes a subsection of a URL.
Assembly: System.Web (in System.Web.dll)
Applies the encoding logic of the 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 127 and greater or less than 32 are URL-encoded. Spaces are not URL-encoded by this method, because ASP.NET encodes spaces as a separate operation in a helper class.
Encodes spaces as %20.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.