HttpServerUtility::HtmlDecode Method (String, TextWriter)
Decodes an HTML-encoded string and sends the resulting output to a TextWriter output stream.
Assembly: System.Web (in System.Web.dll)
HTML encoding makes sure that text is displayed correctly in the browser and not interpreted by the browser as HTML. For example, if a text string contains a less than sign (<) or greater than sign (>), the browser would interpret these characters as the opening or closing bracket of an HTML tag. When the characters are HTML encoded, they are converted to the strings < and >, which causes the browser to display the less than sign and greater than sign correctly.
HtmlDecode decodes text that has been transmitted to the server.
To encode or decode values outside of a web application, use the WebUtility class.
The following example decodes a string that has been HTML-encoded for transmission over HTTP. It decodes the supplied string named EncodedString which contains the text "This is a <Test String>.", and copies it into the string named DecodedString as "This is a <Test String>.".