Utilizing ConvertToXhtml filter functionality Server-side?

2 posts, 0 answers
  1. Allen Smothers
    Allen Smothers avatar
    40 posts
    Member since:
    Nov 2006

    Posted 20 Apr 2010 Link to this post

    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
  2. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 21 Apr 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top