简体   繁体   English

如何将页面上的CKEDitor实例设置为始终为RTF编辑器

[英]How to set an instance of CKEDitor on the page to be always Rich Text Editor

I have been working on the DNN site (ASP.NET, C#, Visual Basic, Visual Studio 2012 Express for Web) that uses CKEditor on the page. 我一直在使用页面上的CKEditor的DNN网站(ASP.NET,C#,Visual Basic,Visual Studio 2012 Express for Web)上工作。 The example is: 示例是:

<dnn:TextEditor ID="txtRichBox" runat="server" Width="850" TextRenderMode="Raw" HtmlEncode="False" defaultmode="Rich" height="350" Visible="false" choosemode="true" chooserender="False" />

I would like to have only Rich Text Editor on the page, not Basic Text Box. 我只希望页面上有Rich Text Editor,而不是Basic Text Box。 How can I do that? 我怎样才能做到这一点? Thank you in advance for any help. 预先感谢您的任何帮助。

Use JavaScript to attach CKEditor to the control : 使用JavaScript将CKEditor附加到控件:

<script>
    CKEDITOR.replace( 'ID of textbox control' );
</script>

Might I recommend the documentation for CKEditor? 我可能会推荐CKEditor的文档吗? It's here . 在这里

You can't just invent properties like choosemode and chooserender and expect it to work. 您不能仅仅发明诸如choosemodechooserender类的属性并期望它起作用。 The Editor has a limited number of properties . 编辑器的属性数量有限

The easiest way is to hide the radio buttons Basic Text Box and Rich Text Editor with CSS so users can't switch between them. 最简单的方法是使用CSS隐藏单选按钮“ Basic Text Box和“ Rich Text Editor ,以便用户无法在它们之间切换。 By default the Editor is loaded, not the underlying basic TextBox. 默认情况下,将加载编辑器,而不是基础的基本TextBox。

<style>
    .dnnTextPanelView {
        display: none;
    }
</style>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM