Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net 4.0 with TinyMCE and XML Encoding re-encodes Content on Postback

i have a ASP.NET 4.0 based CMS, where i use the TinyMCE (3.4) via jQuery to edit one Textbox.

In addition to this i have several other textboxes. There is also another DropDown List on the Page, which controls the Contenttype. This Control has AutoPostback enabled and sets the visibility on the textboxes regarding the selectes item.

As i want to keep the Postback Validation on i have configured the TinyXML to use xml for the content serialisation (encoding: "xml").

Now i have the problem, when a postback from e.g. the DropDown List occures, the re-encodes the content.

Init: "Hallo"
1st Postback: "<p>Hallo</p>"
2nd Postback: "<p>&lt;p&gt;Hallo&lt;/p&gt;</p>"

i have enabled the original textarea via css and this seems to be a problem of the TinyMCS's Save method. Does anybody have a solution, how to fix this issue maybe with a custom save_callback on the TinyMCE?

like image 975
Christoph Avatar asked Jan 20 '11 15:01

Christoph


1 Answers

Could it be that the data is being reloaded into the tinymce window after it is saved?

When I encountered this before in TinyMCE/WebForms, it was easily fixed by decoding the data before populating the form field and after postbacks:

TextAreaID.Text = Server.HtmlDecode("<p>hello</p>");

like image 87
Evert Avatar answered Nov 01 '22 16:11

Evert