Try using Server.HTMLEncode
and Server.HTMLDecode
.
- 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.
More details
http://msdn.microsoft.com/en-in/library/ms525347%28v=vs.90%29.aspx
Edit 1
Some SO links
ASP.NET Server.HtmlEncode Limitations
Why is Server.HtmlEncode required?
Edit 2
You can refer to this link
What characters or character combinations are invalid when ValidateRequest is set to true?