HttpUtility.HtmlEncode not producing CSS-safe text

K

Keith Patrick

I have some data coming in from a DB that I need to render in a multiline
textbox. I'd rather keep the markup intact, but for some reason, multiline
textboxes won't escape the codes. But the big problem happens when I try to
encode the string anyway. My text has some special characters, like ®, that
encode to ®. This error code is apparently causing CSS validation
errors because HttpRequest.ValidateString (via its CSS helper class) doesn't
like & when it is followed by a #. So is there a different way to encode
this string to display properly in an ASP.Net page (and submit, but without
turning of request validation for the entire page)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top