0

我一直在做一个使用 Telerik RadEditor 控件(版本 2009.1.402.35)的项目。在大多数情况下,一切似乎都可以正常工作(即粗体、斜体、颜色等)。但问题在于,当用户编辑内容时,缩进和列表(项目符号和编号)功能无法正确呈现在屏幕上。有趣的是,当单击缩进或列表按钮时,它确实会向 html 添加正确的标记。

该问题体现在 MSIE 6,7、8 和 FireFox 3(迄今为止我测试过的唯一一个)中。编辑器在 SharePoint 环境上下文中运行的用户控件内部使用。我怀疑这是某种类型的 CSS 冲突,或者与我使用它的方式不兼容。关于为什么某些功能可以使用此控件但其他功能不起作用的任何想法?

  <telerik:RadEditor ID="topicBody" Runat="server" Width="100%" height="300" >
    <Tools>
        <telerik:EditorToolGroup Tag="Top">
            <telerik:EditorTool Name="Bold" />
            <telerik:EditorTool name="Italic"/>
            <telerik:EditorTool name="Underline"/>  
            <telerik:EditorTool name="StrikeThrough"/>  
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool name="JustifyLeft"/>
            <telerik:EditorTool name="JustifyCenter"/>
            <telerik:EditorTool name="JustifyRight"/>
            <telerik:EditorTool name="JustifyFull"/>
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool name="InsertOrderedList"/>
            <telerik:EditorTool name="InsertUnorderedList"/>
            <telerik:EditorTool name="Outdent"/>
            <telerik:EditorTool name="Indent"/>
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool name="FontName"/>
            <telerik:EditorTool name="FontSize"/>
            <telerik:EditorTool name="ForeColor"/>
            <telerik:EditorTool name="BackColor"/>                  
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup Tag="Middle">
            <telerik:EditorTool name="Undo"/>
                <telerik:EditorTool name="Redo"/>   
                <telerik:EditorSeparator Visible="true" />              
            <telerik:EditorTool name="LinkManager"/>
            <telerik:EditorTool name="Unlink"/>
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool name="InsertTable"/>
            <telerik:EditorSeparator Visible="true" />      
                <telerik:EditorTool name="Cut"/>
            <telerik:EditorTool name="Copy"/>
                <telerik:EditorTool name="PasteAsHtml"/>
                <telerik:EditorTool name="PastePlainText"/>
                <telerik:EditorSeparator Visible="true" />
                <telerik:EditorTool name="Print"/>                                 
        </telerik:EditorToolGroup> 
    </Tools>
</telerik:RadEditor>
4

3 回答 3

2

请参阅以下帮助文章,该文章提供了如何解决问题的指导: http ://www.telerik.com/help/aspnet-ajax/editor-content-area-appearance-problems.html

于 2010-01-05T16:00:16.307 回答
1

这个问题原来是冲突的CSS。主站点 CSS 文件具有匹配 BLOCKQUOTE、OL、UL 和 LI 的选择器,这会干扰 RadEditor。考虑到 RadEditor 使用 IFrame 来呈现用户正在编辑的内容,这令人惊讶。我不认为它应该从容器站点中提取 css。这似乎是控件中的一个错误,它允许样式渗透到 iframe,它应该是一个没有外部 CSS 的岛。

于 2009-06-08T17:31:30.797 回答
0

请尝试使用以下代码:

if (Request.Browser.Browser.ToLowerInvariant() == "firefox")
            {
                System.Reflection.FieldInfo browserCheckedField = typeof(RadEditor).GetField("_browserCapabilitiesRetrieved", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
                browserCheckedField.SetValue(RadEditor1, true);
                System.Reflection.FieldInfo browserSupportedField = typeof(RadEditor).GetField("_isSupportedBrowser", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
                browserSupportedField.SetValue(RadEditor1, true);
            }
于 2012-08-28T11:38:40.020 回答