This documentation is archived and is not being maintained.

HttpUtility.UrlPathEncode Method

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Encodes the path portion of a URL string for reliable HTTP transmission from the Web server to a client.

[Visual Basic]
Public Shared Function UrlPathEncode( _
   ByVal str As String _
) As String
public static string UrlPathEncode(
 string str
public: static String* UrlPathEncode(
 String* str
public static function UrlPathEncode(
   str : String
) : String;


The text to URL-encode.

Return Value

The URL-encoded text.


URL encoding ensures that all browsers will correctly transmit text in URL strings. Characters such as ?, &,/, and spaces may be truncated or corrupted by some browsers so those characters must be encoded in <A> tags or in query strings where the strings may be re-sent by a browser in a request string.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpUtility Class | HttpUtility Members | System.Web Namespace