• KindEditor编辑器For DotNet控件


    KindEditor很不错,刚接触不久,非常喜欢。KindEditor网站有ForPHP等扩展的,没有ForNet的。

    我是搞.net开发的,就用它简单封装了一个控件,拖过来即可使用,使用更加简单。源码提供给大家,有兴趣的朋友可以进一步完善。

    源码下载  http://yunpan.cn/cAqMgHW98ymFN  访问密码 bd42

     

    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" TagPrefix="cc1" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="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>
  • 相关阅读:
    HTTPS之acme.sh申请证书
    GoAccess日志分析工具
    KVM之CPU虚拟化
    自动化运维之PSSH
    Hadoop+HBase 集群搭建
    SSH + Google Authenticator 安全加固
    查看数据的类型(python)
    在word中,替换多个词语。正则表达式中 [] {} 是可以连用的(python)
    方差分析的前提,与检验,以及球形检验
    清屏处理(汇编)
  • 原文地址:https://www.cnblogs.com/2hill/p/3527431.html
Copyright © 2020-2023  润新知