KindEditor很不錯,剛接觸不久,非常喜歡。KindEditor網站有Forphp等擴展的,沒有ForNet的。
我是搞.net開發的,就用它簡單封裝了一個控件,拖過來即可使用,使用更加簡單。源碼提供給大家,有興趣的朋友可以進一步完善。
源碼下載
1、第一次使用,需要配置一下web.config。
<configSections> <section name="KindEditor" type="KindEditorForDotNet.ConfigHandler,KindEditorForDotNet"/> </configSections> <KindEditor> <!--編輯的所在路徑--> <item key="BasePath" value="~/KindEditor"/> <!--上傳文件的路徑--> <item key="UploadPath" value="~/Upload"/> <!--主題類型--> <item key="Theme:simple" value="'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link'"/> <item key="Theme:book" value="'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat'"/> </KindEditor>
2、然后引用DLL文件,包括KindEditorForDotNet、LitJSON.dll;
3、使有的時候,直接把控件拖到webform中即可,如果控件沒有出現在控件欄目,直接引用也可以
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EditorDemo._Default" %><%@ Register Assembly="KindEditorForDotNet" Namespace="KindEditorForDotNet" Tagxmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>無標題頁</title></head><body> <form id="form1" runat="server"> <div> 說明:該控件繼承自TextBox; 可以設置Width、Height、Enabled(是否只讀)<hr /> 默認風格<br /> <cc1:editor id="Editor1" runat="server" Height="100px" Width="100%"></cc1:editor><br /> 自定義風格(風格來自于web.config中配置)<br /> <cc1:Editor ID="Editor2" runat="server" ThemeType="simple" Height="100px"></cc1:Editor></div> 顯示字數 (已經輸入:<span class="count"></span>) <br /> <cc1:Editor ID="Editor3" runat="server" ThemeType="book" afterChange="function(){K('.count').html(this.count('text'))}" Height="60px" Width="300px"></cc1:Editor> <hr /> 10522779@QQ.com </form></body></html>
源碼下載
我的QQ:10522779
新聞熱點
疑難解答