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

[Solved] Possible Radeditor Bug With Toolsfile

1 Answer 176 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Erin
Top achievements
Rank 1
Erin asked on 21 Mar 2008, 07:03 AM

Hello, I just noticed that my RadEditors have a problem generating correct HTML Content when I use a toolsfile.  If I write a simple text in the editor, center it, change the font to a large size and change the color and push a button which posts back, the content gets generated as this:

"<p align=\"center\"><span>Test</span></p>\r\n"

But if I remove the reference to the toolsfile, the HTML content gets correctly generated like this

"<p align=\"center\"><strong><span style=\"font-size: 48px; color: #ff6666\">Test</span></strong></p>\r\n"


Here is my declaration in a plain vanilla aspx file:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="teleriktest.aspx.cs" Inherits="teleriktest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
<script runat="server"></script>
</head>
<body>
    <form id="form1" runat="server">
   
    <asp:ScriptManager ID="scriptManager" EnablePartialRendering="true" runat="server" />

         <telerik:radeditor runat="server" id="radEditor" height="400px" toolsfile="~/Telerik/Editor/Toolsfile.xml"
        editmodes="Design" autoresizeheight="true" skin="Web20">
            <CssFiles>
                <telerik:EditorCssFile Value="~/Skins/Web20/EditorContentArea.css" />
                <telerik:EditorCssFile Value="~/Skins/Web20/Editor.Web20.css" />
               
            </CssFiles>
       
        </telerik:radeditor>
        <asp:Button runat="server" ID="btnimage" OnClick="onclicked" Text="submit" />
    </form>
</body>
</html>

and the toolsfile is this:

<root>
 <tools>
  <tool name="FindAndReplace"/>
  <tool name="Print"/>
  <tool name="AjaxSpellCheck"/>
  <tool separator="true"/>
  <tool name="Cut"/>
  <tool name="Copy"/>
  <tool name="Paste"/>

  <tool separator="true"/>
  <tool name="Undo"/>
  <tool name="Redo"/>
  <tool separator="true"/>
  <tool name="ImageManager"/>
  <tool name="InsertTable"/>
  <tool separator="true"/>
  <tool name="LinkManager"/>
  <tool name="Unlink"/>
  <tool name="InsertSymbol"/>
  <tool name="ToggleTableBorder"/>
 </tools>
 <tools>
  <tool name="Bold"/>
  <tool name="Italic"/>
  <tool name="Underline"/>
  <tool separator="true"/>
  <tool name="JustifyLeft"/>
  <tool name="JustifyCenter"/>
  <tool name="JustifyRight"/>
  <tool name="JustifyFull"/>
  <tool separator="true"/>
  <tool name="InsertOrderedList"/>
  <tool name="InsertUnorderedList"/>
  <tool name="Outdent"/>
  <tool name="Indent"/>
  <tool name="FormatBlock"/>
  <tool separator="true"/>
 </tools>
 <tools>
  <tool name="FontName"/>
  <tool name="FontSize"/>
  <tool name="ForeColor"/>
  <tool name="BackColor"/>
  <tool name="ApplyClass"/>
  <tool name="InsertCustomLink"></tool>
 </tools>
 <links>
  <link name="telerik" href="http://www.telerik.com">
   <link name="Products" href="http://www.telerik.com/products" />
   <link name="Purchase" href="http://www.telerik.com/purchase" />
   <link name="Support" href="http://www.telerik.com/support" />
   <link name="Client.Net" href="http://www.telerik.com/clientnet" />
  </link>
  <link name="Microsoft">
   <link name="Main Site" href="http://www.microsoft.com" />
   <link name="MSDN Online" href="http://msdn.microsoft.com" />
   <link name="Windows Update" href="http://windowsupdate.microsoft.com" />
  </link>
  <link name="Search Engines">
   <link name="Google" href="http://www.google.com" />
   <link name="Yahoo" href="http://www.yahoo.com" />
   <link name="AltaVista" href="http://www.altavista.com" />
  </link>
 </links>
</root>

Upon postback in the "onclicked" event, if you look at the radeditor.content you will notice the incorrect HTML when the toolsfile is used.  The incorrect values are random (sometimes it returns the correct value, sometimes it doesn't) but everything is fine as soon as your remove the reference to the toolsfile.  Another thing I noticed is that the font sizes change from points to numbers 1-7.  What's causing these two problems?

Thanks,
Erin

1 Answer, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 21 Mar 2008, 10:48 AM
Hi Erin,

Thank you for reporting this problem.

It seems that it is related to the FontSize dropdown.

RadEditor offers two different apply font size dropdowns: FontSize which works with the browser font sizes from 1 to 7 and a RealFontSize dropdown which works with font sizes in pixels and points.

All you need to do to fix the problem is to replace the FontSize dropdown in the ToolsFile.xml <tool name="FontSize"/> with the RealFontSize dropdown <tool name="RealFontSize"/>.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Erin
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or