Search articles in this blog and in my other related blogs.


Tuesday, July 1, 2008

Server.HTMLEncode Method


The HTMLEncode method applies HTML encoding to a specified string. This is useful as a quick method of encoding form data and other client request data before using it in your Web application. Encoding data converts potentially unsafe characters to their HTML-encoded equivalent.

If the string to be encoded is not DBCS, HTMLEncode converts characters as follows:

  • The less-than character (<) is converted to <.
  • The greater-than character (>) is converted to >.
  • The ampersand character (&) is converted to &.
  • The double-quote character (") is converted to ".
  • Any ASCII code character whose code is greater-than or equal to 0x80 is converted to &#, where is the ASCII character value.

source:http://msdn.microsoft.com/en-us/library/ms525347.aspx

0 comments: