Server Side Word Format Cleaning

4 posts, 0 answers
  1. Sean
    Sean avatar
    10 posts
    Member since:
    Jan 2009

    Posted 07 Apr 2011 Link to this post

    Hello,

    I'd like to see if it's possible to use a dynamically generated RadEditor to return a plain text string all from the server side.

    Dim myHTML as String = "Some text <strong>with formatting.</strong>"
      
    Dim myEditor as New RadEditor
    myEditor.Content = myHTML
    myEditor.DataBind()
    myEditor.StripFormattingOptions = EditorStripFormattingOptions.All
      
    myHTML = myEditor.Content

    Now I realize that the StripFormattingOptions is only going to work on a client side paste event.  So I am wondering if there is a way to either use client side script to get the plain text or some other method that i'm missing.

    Hopefully that makes sense! Thanks,
    Sean
  2. Rumen
    Admin
    Rumen avatar
    13980 posts

    Posted 08 Apr 2011 Link to this post

    Hello Sean,

    You can try the solution provided in the following help article: Cleaning Word Formatting On Page Load And On Submit.

    Greetings,
    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. Sean
    Sean avatar
    10 posts
    Member since:
    Jan 2009

    Posted 08 Apr 2011 Link to this post

    Thanks for the reply Rumen, unfortunately this doesn't solve the scenario.  The Editor control is never rendered client side, therefore we won't have access to the OnClientLoad functionality.

    Perhaps this could be a feature enhancement by adding a new server side function / sub routine that cleans up HTML formatting with the ability to set cleaning options.

    Looks like for now I will have to stick to a RegExp solution.

    Thanks Again,
    Sean

  4. Rumen
    Admin
    Rumen avatar
    13980 posts

    Posted 11 Apr 2011 Link to this post

    Hi Sean,

    Yes, the word stripping feature is implemented entirely on the client and we do not offer a server side solution.
    If you would like you can put the editor in a hidden div element <div style="display:none"><telerik:RadEditor .../></div> and use the solution provided in the article.
    Of course another approach is to write your own regular expressions and strip the formatting entirely on the server without using RadEditor.

    Greetings,
    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
Back to Top