首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Telerik RadEditor渲染问题

Telerik RadEditor渲染问题
EN

Stack Overflow用户
提问于 2009-06-08 16:27:03
回答 3查看 10.5K关注 0票数 0

我一直在做一个项目,其中我们使用Telerik RadEditor控件(版本2009.1.402.35)。在大多数情况下,一切似乎都很好用(例如,粗体,斜体,颜色等)。但问题是,当用户编辑内容时,缩进和列表(项目符号和编号)功能不能在屏幕上正确呈现。有趣的是,当单击缩进或列表按钮时,它会将正确的标记添加到html中。

这个问题在MSIE6、7、8和FireFox 3(我到目前为止唯一测试过的)中都有体现。该编辑器在运行于SharePoint环境上下文中的用户控件中使用。我怀疑这是某种类型的CSS冲突,或者与我使用它的方式不兼容。你有什么想法来解释为什么这个控件中的一些函数可以工作,而其他的就不行?

代码语言:javascript
运行
复制
  <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>
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2009-06-08 17:31:31

这个问题被证明是相互冲突的CSS。主站点CSS文件具有与BLOCKQUOTE、OL、UL和LI匹配的选择器,这些选择器干扰了RadEditor。考虑到RadEditor使用IFrame来呈现用户正在编辑的内容,这是令人惊讶的。我不认为它应该从容器站点中拉出css。这似乎是控件中的一个bug,它允许样式渗入Iframe,而Iframe应该是一个没有外部CSS的孤岛。

票数 1
EN

Stack Overflow用户

发布于 2010-01-06 00:00:16

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

票数 2
EN

Stack Overflow用户

发布于 2012-08-28 19:38:40

请尝试使用以下代码:

代码语言:javascript
运行
复制
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);
            }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/965763

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档