温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

dotnet封装的kindeditor编辑器控件怎么用

发布时间:2021-07-26 10:24:49 来源:亿速云 阅读:86 作者:chen 栏目:开发技术

本篇内容介绍了“dotnet封装的kindeditor编辑器控件怎么用”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!



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>

“dotnet封装的kindeditor编辑器控件怎么用”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI