I have a textfield which displays a string which contains < and >. The code throws an error because of that. How can I allow the usage of those chars in my textfield?
Convert them to <
and >
. In Html, <
is converted to <
and >
is converted to >
without it thinking it's part of the markup. So the string
will be <Blah>
.
Edit: I forgot, to automatically convert them and escape all HTML characters (so this isn't an issue for other things), in Asp.net you can use Server.HtmlEncode(string)
to automatically convert all characters that could cause issues to their HTML equivalent.