I first developed a Web site, need to use a rich text editor, then the Internet to find a lot of posts, tried n times. Finally used the kindeditor, through many tests and see the official demo, the final debugging success.
Dry goods down here.
1. Download:
I downloaded the 4.1.10 version on the website.
2. Decompression, implant project:
A. Unpack it-> Open the kindeditor-4.1.10 folder, with ASP.net development, the Jsp,php,examples,asp folder deleted, and then the kindeditor-4.1.10 folder renamed editor, copied to the project root directory.
B. Copy the LitJSON.dll file under Editor->asp.net->bin to the project root, and then add a reference-> browse-> add LitJSON.dll
3.html content:
<script charset= "Utf-8" src= "/editor/kindeditor.js" ></script> <script charset= "Utf-8" src= "/editor/" Lang/zh_cn.js "></script> <script> kindeditor.ready (function (K) {var editor1 = k.create (' #edit Or_id ', {<span style= "White-space:pre" > </span>//this #editor_id corresponds to <span style= "font-family:arial, Helve TICA, Sans-serif; " >textarea label of id</span> Csspath: '. /editor/plugins/code/prettify.css ', <span style= ' white-space:pre ' > </span>//file paths are modified relative to the location of this HTML file u Ploadjson: '.. /editor/asp.net/upload_json.ashx ', Filemanagerjson: '.
/editor/asp.net/file_manager_json.ashx ', Allowfilemanager:true, Aftercreate:function () {
var self = this;
K.ctrl (document, function () {self.sync ();
K (' form[name=example] ') [0].submit ();
});
K.ctrl (Self.edit.doc, function () { Self.sync ();
K (' form[name=example] ') [0].submit ();
});
}
});
Prettyprint ();
}); </script> content: <br/> <form id= "Form1" action= "Test.ashx" method= "POST" > <textarea id= "editor_id" NA Me= "Content" style= "width:700px;height:300px;" > Kindeditor </textarea> <input type= "Submit" value= "published"/>
Code in the 4.ashx file:
var content = context. request["Content"];
Direct use of generic receive. Save in the database with the text type, you can save inserted pictures, links, font style colors, and so on. Save in Access is a memo type.
*5. If you are submitting content, you encounter the following problem:
Then add the following code to the Web.config file
<system.web>
Finally show the effect
Local upload picture to article:
After submission through the background output:
Debugging successful.
Thanks for watching, there are questions to share and discuss