This documentation is archived and is not being maintained.

HttpServerUtility.UrlDecode Method (String)

.NET Framework 1.1

URL-decodes a string and returns the decoded string.

[Visual Basic]
Overloads Public Function UrlDecode( _
   ByVal s As String _
) As String
[C#]
public string UrlDecode(
 string s
);
[C++]
public: String* UrlDecode(
 String* s
);
[JScript]
public function UrlDecode(
   s : String
) : String;

Parameters

s
The text string to decode.

Return Value

The decoded text.

Remarks

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.

Example

The following example decodes the string named EncodedString (received in a URL) into the string named DecodedString.

[Visual Basic] 
Dim DecodedString As String = Server.UrlDecode(EncodedString)
   

[C#] 
String DecodedString = Server.UrlDecode(EncodedString);
   

[C++] 
String* DecodedString = Server->UrlDecode(EncodedString);
   

[JScript] 
var decodedString : String = Server.UrlDecode(encodedString)
   

Requirements

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

See Also

HttpServerUtility Class | HttpServerUtility Members | System.Web Namespace | HttpServerUtility.UrlDecode Overload List

Show: