Answered by:
using a htmleditorextender causes problems when you want to edit the text later.

Question
-
User-1112034352 posted
I have a form where has a textbox with an htmlEditorExtender. It works. He can format his own content, or he can paste in entire webpages from elsewhere in the web. In source view, he sees the tags, and in regular view he sees the formatted text.
But...
I have another page where I want to let the user edit this text, if he wants to update it. Again, I use a textbox with an htmleditorextender.
The problem is, that when I get his original markup from a database and put it into the textbox, that original markup gets encoded. so for instance, a '<' character becomes <
I think this is a bug.
If a textbox has an htmleditorextender attached to it, then it should accept markup, and not try to encode it.
But since the problem exists, is there anyway, perhaps in the 'load' event of the textbox, to decode the text coming in?
Thanks,
Sunday, April 20, 2014 4:46 PM
Answers
-
User-933407369 posted
Workaround: When you get the text out of the editor, use HtmlDecode to convert it: String fixedText = HttpUtility.HtmlDecode(txtBody.Text);
please refer to the link for more information:
HtmlEditorExtender encoding HTML in postback when using LoadControl()
https://ajaxcontroltoolkit.codeplex.com/workitem/27170
Hope it helps you.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, April 21, 2014 5:22 AM -
All replies
-
User-933407369 posted
Workaround: When you get the text out of the editor, use HtmlDecode to convert it: String fixedText = HttpUtility.HtmlDecode(txtBody.Text);
please refer to the link for more information:
HtmlEditorExtender encoding HTML in postback when using LoadControl()
https://ajaxcontroltoolkit.codeplex.com/workitem/27170
Hope it helps you.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, April 21, 2014 5:22 AM -