This is a migrated thread and some comments may be shown as answers.

Automatic modifications in Rad Editor

5 Answers 44 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Naupad
Top achievements
Rank 1
Naupad asked on 25 Jan 2012, 06:12 PM
I am getting XSL data in the RadEditor with EditMode as HTML in the mark-up. But the Editor is automatically modifying my XSL data and showing it in Rad Editor. I want exact same data to be shown. I tried adding ContentFilter="ConvertToXhtml" but it didn't work.

What should I do to show my XSL data in Rad Editor exactly same as in database?

FYI: I have set Rad Editor in Editmode="HTML" so there is no option of switching modes.

HELP!!!!!!!!!

5 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 26 Jan 2012, 04:54 PM
Naupad:

You should understand that RadEditor is primarily designed to be an HTML Editor and not for editing XML. RadEditor can really be thought of as an advanced <asp:TextBox> and that it's exported content is a standard string.

Since your XSL content is not HTML, once it gets loaded in the iframe content area, the rich text engine of the browser and RadEditor's filters will modify it, trying to validate it using HTML rules. RadEditor's filters, by default, will try to convert it to XHTML.

You can disable RadEditor's built-in content filters and the editor will leave the browser to change the content:
<telerik:RadEditor ID="RadEditor1" ContentFilters="None" runat="server" />

Then, it is up to you to handle the exported content and write it in the required way in the desired location.

Hope this helps!
0
dorina
Top achievements
Rank 1
answered on 10 Jul 2012, 08:25 AM
Hello,

I have the same problem with XML/XSL. I've set ContentFilters="None"  but the content is changed anyway. Is there another solution to this issue?

Thank you.
0
Rumen
Telerik team
answered on 10 Jul 2012, 12:21 PM
Hi,

When the ContentFilters property is set to None, RadEditor does not modify the content, but the browser's rich text editing engine.

You can test your XML content with the attached editable iframe html page. Load it in the browser, enable the JavaScript, load your custom content in the editable iframe and see how the different browsers will modify it. Note that the HTML page does not have a DOCTYPE and it will be rendered in quirksmode. You can use the IE developer toolbar to change the mode to IE9, IE8, IE7 and see how the rich text editing engines of the different versions of IE behave.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
dorina
Top achievements
Rank 1
answered on 10 Jul 2012, 01:35 PM
Hello,


Thanks for your reply.
Yes you were right, my content completely changes in iframes. But, why setting ContentAreaMode="Div" 
doesn't change the behaviour of RadEditor(I mean the XML/XSL changes in both cases).

Thank you
0
Rumen
Telerik team
answered on 12 Jul 2012, 04:20 PM
Hello,

The behavior could be due to that the div content area is part of the same page and the page DOCTYPE is applied to it. The iframe content area is another document, which does not have applied by default a DOCTYPE. You can apply a DOCTYPE to the iframe by loading full HTML content in RadEditor.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Naupad
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
dorina
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or