I have built a little editor for resource files.
So I show the content of a resource item in a textarea.
<textarea cols="85" rows="12" id='EditItemTextArea'><%# Eval("Translation")%></textarea>
However, that content is shown as html symbols, so when I load < in the textarea and i look at the source, I see <
like this:
<textarea cols="85" rows="12" id='EditItemTextArea'>consumption.<br><br></textarea>
But in the textarea (in the browser) a < is shown, and when I save the content of the textarea, I read < and not <
Is there a way to solve this?
Have you tried HttpUtility.HtmlEncode (and HttpUtility.HtmlDecode to get a decoded HTML back)? Your code could look like the following:
Code-behind: