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

[Solved] Server-side XHTML support in RadEditor

1 Answer 80 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Joseph Alfano
Top achievements
Rank 1
Joseph Alfano asked on 03 Aug 2009, 09:04 PM
Hi,

We are using RadEditor version 2009.2.701.35 (second quarter 2007).  We need to insure that the content returned by the RadEditor is XHTML compliant.  I have been investigating the RadEditor's support for XHTML compliance.  What I find is that if I switch to the HTML mode in the editor and directly type in non-XHTML-compliant markup and then switch back to the design mode, the RadEditor does a client-side fix of the non-compliant markup (for example, <u> goes to <span style="text-decoration: underline">, <br> goes to <br />, etc), which is great.

However, if I enter non-compliant markup in HTML mode and then remain in HTML mode, when I click a button to initiate a postback, I find that when look at the server-side RadEditor.Content property, I see my non-XHTML-compliant markup.  Thus the automatic conversion of non-XHTML-compliant markup to compliant markup only appears to occur if the user switches back to Design mode before posting back to the server.  If the user enters invalid markup in HTML mode and then submits, the invalid markup is passed to the server.

Are there any server-side properties on the RadEditor that I can access that are guarenteed to return XHTML-compliant content? I noticed that in the non-AJAX ASP.Net version of the RadEditor, there used to be an XHTML server-side property, but that has been replaced by the "Content" property.  However, the "Content" property does not appear to insure that only XHTML-compliant content is returned.

I would appreciate any suggestions you might have.

Thanks so much for the assistance.

Joe

1 Answer, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 06 Aug 2009, 08:56 AM
Hi Joseph,

Indeed in the original Q2 2009 release, when in HTML mode, the editor would not execute its client-side content filters to convert the content to be XHTML compliant.

However, I believe we were able to fix this subsequently, so the latest Internal Build should work fine.

On a side note, in case you wish to keep your current Telerik.Web.UI version, you can easily "trick" the editor to execute those filters by forcing it to be in Design mode at the time of submitting the page. To do so all you need is hook to the OnClientSubmit event, e.g.

<telerik:RadEditor OnClientSubmit = "OnClientSubmit" .../>

<script>
                function OnClientSubmit(editor)
                {
                    editor.set_mode(1); //Force design mode
                }

</script>


Best regards,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Joseph Alfano
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Share this question
or