ASP. NET uses the Rich Text control KindEditor (one-step in place, which is valid for test), asp. netkindeditor
1. Copy the decompressed "KindEditor" folder to the root directory of the project (this KindEditor folder has been optimized)
For: http://pan.baidu.com/s/1eS1PRii
2. Introduce the KindEditor external style sheet file and necessary external js files in the <! -- Import a style sheet -->
<Link rel = "stylesheet" href = "../kindeditor/themes/default/default.css"/>
<Link rel = "stylesheet" href = "../kindeditor/plugins/code/prettify.css"/>
<! -- Introduce external js files -->
<Script type = "text/javascript" charset = "UTF-8" src = "../kindeditor/plugins/code/pretitor. js"> </script>
<Script type = "text/javascript" charset = "UTF-8" src = "../kindeditor/kindeditor-min.js"> </script>
<Script type = "text/javascript" charset = "UTF-8" src = "../kindeditor/lang/zh_CN.js"> </script>
3. Insert a multi-line text box Server Control (Textbox, note that its property TextMode is set to MutiLine). The generated tag is as follows:
<Asp: TextBox ID ="TxtCont"Runat =" server "TextMode =" MultiLine "Rows =" 5 "> </asp: TextBox>
Remember the ID of this control and use it in the next js Code.
4. Insert the <script> mark in the <! -- Start the KindEditor plug-in to convert a common multi-line text box into rich text -->
<Script type = "text/javascript">
KindEditor. ready (function (K ){
Var editor1 = K. create ('#TxtCont', {// Note that the ID here is consistent with the ID in the previous step.
CssPath: '../kindeditor/plugins/code/prettify.css ',
UploadJson: '../kindeditor/asp.net/upload_json.ashx ',
FileManagerJson: '../kindeditor/asp.net/file_manager_json.ashx ',
AllowFileManager: true,
AfterCreate: function (){
Var self = this;
K. ctrl (document, 13, function (){
Self. sync ();
K ('form [name = example] ') [0]. submit ();
});
K.ctrl(self.edit.doc, 13, function (){
Self. sync ();
K ('form [name = example] ') [0]. submit ();
});
}
});
PrettyPrint ();
});
</Script>
5. Copy the "\ kindeditor \ asp.net \ bin \ LitJSON. dll" file to the "bin" directory under the project root directory.
Note: "LitJSON. dllIt is a compiled Assembly file. Only with its support can we use upload images and other advanced functions.
6. Add an attribute to the Page command starting with the aspx file: ValidateRequest = "false"
The purpose of this operation is to submit the marked content. If this attribute is not added, the system will disable this illegal request based on security considerations.
7. Complete
Test the expressions, upload images, links, maps, and videos. If it succeeds, give me a thumbs up!