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

Lots of extra HTML output for RadEditor

3 Answers 63 Views
Editor
This is a migrated thread and some comments may be shown as answers.
msigman
Top achievements
Rank 2
msigman asked on 18 Oct 2010, 09:46 PM
I have a RadEditor with very basic functionality.  Nothing in the modules section, using external Toolbar file, and external CSS file.

However, this is generating a tremendous amount of code to the page for things like Image Manager, Document manager, etc, which I am not using.  Also it's adding a lot of extra code for localization: $create(Telerik.Web.UI.RadEditor, {"_localization":{"addcustomcolor":"Add Custom Color...","addcustomhexcolor":"Add Hex Color...","

Except that I'm not using Add custom color, hex color, or anything other than bold, italic, underline.

How can I trim this way down?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 21 Oct 2010, 01:31 PM
Hello Matthew,

You can remove all the dialog definitions from the dialog opener control after they are populated on the server. Unfortunately, this happens pretty late in the page lifecycle (PreRender event). Here is some sample code that might help:

<telerik:RadEditor ID="RadEditor1" ToolsFile="~/basictools.xml" runat="server">
</telerik:RadEditor>
 
<script type="text/C#" runat="server">
protected override void OnPreRenderComplete(EventArgs e)
{
    RadEditor1.DialogOpener.DialogDefinitions.Clear();
    base.OnPreRenderComplete(e);
}
</script>

This will clear the dialog definitions and will reduce the size of the page on the client.

The localization strings come from the server and they could not be changed.

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
0
msigman
Top achievements
Rank 2
answered on 28 Oct 2010, 10:46 PM
Thanks for your reply.  Unfortunately, the RadEditor in question is located in a Master Page which doesn't have the OnPreRenderComplete event available.  I tried it in OnPreRender and it didn't work.  Any ideas?
0
Rumen
Telerik team
answered on 01 Nov 2010, 05:49 PM
Hi Matthew,

The code below will work without problems if the editor is placed in the content page:

 protected override void OnPreRenderComplete(EventArgs e)
{
RadEditor1.DialogOpener.DialogDefinitions.Clear();
base.OnPreRenderComplete(e);


If the editor is placed in the masterpage then you can subclass the RadEditor control (RadEditor editor = new RadEditor();), override its Control PreRender event, call the base and clear the
DialogDefinitions
 collection using

 RadEditor1.DialogOpener.DialogDefinitions.Clear();

This is the only possible approach that I could suggests.

Kind regards,
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
msigman
Top achievements
Rank 2
Answers by
Rumen
Telerik team
msigman
Top achievements
Rank 2
Share this question
or