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

Utilizing ConvertToXhtml filter functionality Server-side?

1 Answer 29 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Allen Smothers
Top achievements
Rank 2
Allen Smothers asked on 20 Apr 2010, 04:35 PM
Hello,

We're curious if there is a way to utilize the great ConvertToXhtml filter functionality server-side.  

We have some database fields that allow HTML and we're in the process of developing reports that then return the HTML to the user in the form of a Word document.  The document generator we use to process and serve the documents only allows Xhtml compliant html and is very strict.  Problem is, before we implemented Telerik's ASP.NET AJAX RadEditor we allowed (I know it's very bad practice) bits of malformed HTML into the database.  We've since added the ConvertToXhtml filter to the editors.

Do you know of a way to get access to the filter functionality server-side?

I found a post a while back that had some javascript that would achieve what we'd like but we're between a rock and a hard place trying to call back to client-side, perform the filter, then return to the server.  Here is the code I came across:

    <script type="text/javascript"
        function SetContent(content) 
        { 
            var editor = $find("reContent"); 
            editor.set_html(content); 
        } 
         
        function GetContent() 
        { 
            var editor = $find("reContent"); 
            editor.get_html(true); 
        } 
    </script> 


Any help?

Thanks in advance!
Allen

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 21 Apr 2010, 12:45 PM
Hello Allen,

The ConvertToXhtml filter is DOM filter and it can work only on the client.

RadEditor for ASP.NET AJAX does not offer a server property for obtaining the content as XHTML on the server and for this reason the provided JavaScript code is a good way to load content, validate it on the client and obtain it as XHTML.

Sincerely yours,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Allen Smothers
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or