Use of HTML editor Kindeditor

Source: Internet
Author: User

1. Download the latest version of Kindeditor.

2. Put the Kindeditor in your website directory, random directory, as long as the path set to the right can!

3. Add the TextArea input box to display the location of the editor. If you already have textarea, add an ID to the attribute.

<textareaID= "Content_1"name= "Content"style= "width:700px;height:300px;"></textarea>


4. Add the Kindeditor reference to the appropriate page and add the following code:

<Script Type="Text/javascript"CharSet="Utf-8"src="/editor/kindeditor.js"></script>
<Script Type="Text/javascript">
Ke.show ({
ID:'content_1' //textarea the ID of the input box
    });
</script>

Src= ..... This varies depending on where your kindeditor is placed.

get the textual content of textarea:
1. In<textareaID= "Content_1"name= "Content"style= "width:700px;height:300px;"></textarea>
After adding the hidden input and button, the code is as follows:
<inputID= "Content_1_1"type= "hidden"runat= "Server"value="" />
<asp:button id= "Button1" runat= "Server" text= "save" onclientclick= "Save ();" onclick= "Button1_Click" cssclass= "I_1"/>

Adding event-handling code
1. First is the client code, executed before the server code, the code is as follows:


functionSave ()
{
vars=KE.util.getData ("content_1");
S=KE.util.escape (s);
document.getElementById ("content_1_1"). Value=S
}

has been taken in the server control, save the time to maintain the value of content_1_1.
2. Server code, code as follows:


protected &NBSP; void  button1_click ( object sender, EventArgs e)
{
Write the server code you want to execute here, because you have already gone to the value.
}

Use of HTML editor Kindeditor

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.