我一直在做一个项目,其中我们使用Telerik RadEditor控件(版本2009.1.402.35)。在大多数情况下,一切似乎都很好用(例如,粗体,斜体,颜色等)。但问题是,当用户编辑内容时,缩进和列表(项目符号和编号)功能不能在屏幕上正确呈现。有趣的是,当单击缩进或列表按钮时,它会将正确的标记添加到html中。
这个问题在MSIE6、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>
发布于 2009-06-08 17:31:31
这个问题被证明是相互冲突的CSS。主站点CSS文件具有与BLOCKQUOTE、OL、UL和LI匹配的选择器,这些选择器干扰了RadEditor。考虑到RadEditor使用IFrame来呈现用户正在编辑的内容,这是令人惊讶的。我不认为它应该从容器站点中拉出css。这似乎是控件中的一个bug,它允许样式渗入Iframe,而Iframe应该是一个没有外部CSS的孤岛。
发布于 2010-01-06 00:00:16
请参阅以下帮助文章,其中提供了如何解决问题的指导:http://www.telerik.com/help/aspnet-ajax/editor-content-area-appearance-problems.html
发布于 2012-08-28 19:38:40
请尝试使用以下代码:
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);
}
https://stackoverflow.com/questions/965763
复制相似问题