【问题标题】:Ckeditor removes content of textarea when the record is edited in asp.net mvc在asp.net mvc中编辑记录时ckeditor删除textarea的内容
【发布时间】:2015-05-06 10:18:50
【问题描述】:

我在我的项目中使用 CKEDITOR 进行用户输入,它也允许 HTML 输入。我使用这段代码在我的项目中使用这段代码初始化CKEDITOR,效果很好。

   <script>
        CKEDITOR.replace('editor1');
   </script>

问题是当我在编辑页面中编辑相同的记录时,使用相同的初始化脚本导致 CKEDITOR 不包含/保留从数据库中获取的 textarea 中的先前值。每次编辑记录时,它都会加载新的页面来输入内容。

我需要使用 CKeditor 使用以前保存的值来编辑记录/字段。这有什么问题吗? TinyMCE 编辑器中未检测到此问题,即使在编辑记录时也能正常工作。

【问题讨论】:

  • 此问题已解决。将 TextareaFor 替换为 html

标签: javascript jquery asp.net-mvc razor ckeditor


【解决方案1】:

此问题已解决。将 TextareaFor 替换为 html

   <script>
        CKEDITOR.replace('editor1');
   </script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-05
    • 1970-01-01
    • 2016-08-18
    • 2014-03-25
    相关资源
    最近更新 更多