简体   繁体   English

在ASP.NET MVC中编辑记录时,Ckeditor会删除textarea的内容

[英]Ckeditor removes content of textarea when the record is edited in asp.net mvc

I am using CKEDITOR in my project for user input, which allows HTML input as well. 我在项目中使用CKEDITOR进行用户输入,这也允许HTML输入。 I use this code to initialize CKEDITOR in my project using this code, and works well. 我使用此代码在我的项目中使用此代码初始化CKEDITOR,并且效果很好。

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

The problem is when I edit the same record in edit page, with same initialization script resulting the CKEDITOR does not contain / retain the previous value fetched in the textarea from the database. 问题是当我在编辑页面中编辑相同记录时,使用相同的初始化脚本导致CKEDITOR不包含/保留从数据库从textarea中获取的先前值。 Each time when the record is edited it loads fresh and new page to input contents. 每次编辑记录时,它将加载新页面和新页面以输入内容。

I need to edit the record / field with CKeditor with previously saved values. 我需要使用以前保存的值使用CKeditor编辑记录/字段。 Is there any issue with that? 有什么问题吗? This issue has not been detected in TinyMCE editor and it works well even when the record is edited. 在TinyMCE编辑器中未检测到此问题,即使编辑了记录,它也能很好地工作。

this issue has been resolved. 此问题已得到解决。 Replace the TextareaFor<> to html 将TextareaFor <>替换为html

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

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

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