ASP.Net - How do I allow users to enter html tags in textbox without runtime errors?
Posted
by
Coder
on Stack Overflow
See other posts from Stack Overflow
or by Coder
Published on 2013-10-30T15:51:20Z
Indexed on
2013/10/30
15:53 UTC
Read the original article
Hit count: 185
I have an input textbox on an asp.net page and when a user inputs any tags like break tags or bold an error occurs. I currently am using the following to encode the input:
Server.HtmlEncode(mytextbox.Text)
However this only encodes characters when they aren't phrased as an html tag, like if the input is "<<<>>>>>" is there a way for me to allow the user to put the tags in without it leading to a runtime error?
Thanks.
© Stack Overflow or respective owner