System.Web Namespace HttpServerUtility Class
URL-decodes a string and returns the decoded string.
[ VB ]
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;
- s
- The text string to decode.
The decoded text.
URL encoding ensures that all browsers will correctly transmitted text in URL strings. Characters such as "?", "&", "/", and spaces may be truncated or corrupted by some browsers so those characters cannot be used in ASP.NET pages in "<A>" tags or in querystrings where the strings may be sent by a browser in a request string.
The following example decodes the string named EncodedString ( received in a URL ) into the string named DecodedString.
[ VB ]
Dim DecodedString As String = Server.UrlDecode ( EncodedString )
[ C# ]
String DecodedString = Server.UrlDecode ( EncodedString );
HttpServerUtility Members HttpServerUtility.UrlDecode Overload List