In the use of ckeditor appear more problems, one problem is the picture upload problem, one is the second load when the CKEditor edit box can not be a problem
The first problem is that there is a second problem with modifying the CKEditor JS property on the Internet, but it's not very useful here.
First of all my ID is using the dynamic ID [email protected]
<textarea class= "CKEditor" id= "[email protected]" cols= "rows=" 2 "style=" height:100px "> @FieldValue </ Textarea>
<input type= "hidden" name= "@Model. FieldName" value= "@FieldValue"/>
So to get the id var ckname = $ (". CKEditor"). attr ("id");
-------------------------------------------------------------
The next step is to deal with
<script src= "/scripts/ckeditor/ckeditor.js" ></script>
<textarea class= "CKEditor" id= "[email protected]" cols= "rows=" 2 "style=" height:100px "> @FieldValue </ Textarea>
<input type= "hidden" name= "@Model. FieldName" value= "@FieldValue"/>
Resolve CKEditor The second load does not appear to be the problem
<script type= "Text/javascript" >
var ckname = $ (". CKEditor"). attr ("id");
if (ckeditor.instances["" + Ckname + ""])
{
Ckeditor.remove (ckeditor.instances["" + Ckname + ""]);
}
var editor = Ckeditor.replace ("" + Ckname + "");
</script>
That's it, okay?
CKEditor Get value: var Ckcode = (Ckeditor.instances[ckname].getdata ());
About CKEditor Second load problem