asp.net Web site development Rich Text Editor call method

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.