Can someone explain the best way to handle this approach.
I am using TinyMCE editor. The information typed into this is loaded into a XDocument and then written to the database as a string by doing XDocument.ToString()
When I output the content to a webpage I load the string from the database into a XDocument, find the element and do a Html.Encode to write out.
When the data gets put into the database it gets put in this format <p><em>TEST</em>999</p>
When I retrieve it from the XDocument and do a Html.Encode it actually writes to the page
<p><em>TEST</em>999</p>
Obviously this is not what I want, it shouldn't write the HTML to the page for the user to see.
What is the best approach to take. Do a Decode/Encode before it gets put into the database? The Decode/Encode methods confuse me cause I'm not sure what they actually do.
Any help appreciated.