用户名:
密 码: 记住
您当前的位置:首页 > 网络编程 > Net教程

dotnet封装的kindeditor编辑器控件

时间:2015-01-29  来源:互联网  作者:佚名

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" 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 />
</form>
</body>
</html>

来顶一下
返回首页
返回首页
推荐资讯
asp.net中C#获取字符串中汉字的个数的具体实现方法 asp.net中C#获取字符串中汉字的个数符串可以包括数字,字母,汉字或者其他的字符。使用Char类型
subsonic3.0插件更新字符串过长引发的异常修复方法 subsonic3.0插件更新字符串过长引发最近公司客服提交了个BUG,说是更新产品详细信息时,有的可以
相关文章
栏目更新
栏目热门