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

Server Side Word Format Cleaning

3 Answers 117 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 07 Apr 2011, 07:23 PM
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

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 08 Apr 2011, 02:52 PM
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
0
Sean
Top achievements
Rank 1
answered on 08 Apr 2011, 03:24 PM
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

0
Rumen
Telerik team
answered on 11 Apr 2011, 01:04 PM
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
Tags
Editor
Asked by
Sean
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Sean
Top achievements
Rank 1
Share this question
or