I have the tinymce -control as a WYSIWYG-Editior in my asp.net page.
When I have e.g. a Text in Bold, after the Postback it is shown as
"<p><strong>asd</strong></p>"
in the textarea instead of the bolded text.
Any ideas?
My code:
<script type="text/javascript" src="../scripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode: "textareas",
theme: "simple",
encoding: "xml"
});
</script>
<textarea runat="server" id="txtareaTextActivity" name="content" cols="48" rows="5"> </textarea>
I also had the same problem. But fixed it by decoding the textarea
text each time in page load in c# as below:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Some stuff
}
txtDescription.Text = HttpUtility.HtmlDecode(txtDescription.Text);
}
I'm using encoding: "xml"
in tinymce init function. .net version 4.5.1
.
Hope it helps someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With