在ASP.NET项目中使用CKEditor

CKEditor是什么

CKEidtor是一个在线富文本编辑器,可以将让用户所见即所得的获得编辑在线文本,编辑器或自动将用户编辑的文字格式转换成html代码。

在ASP.NET工程中添加CKEditor插件

1.下载插件:可以到CKEditor官方网站下载 CKEditor for ASP.NET Control.网址:http://ckeditor.com/download  解压后得到如下图

2.压缩包找到其中inRelease下的CKEditor.NET.dll和CKEditor.NET.pdb考到你的工程文件夹的Web/bin/文件下

3.在工程中右击Web工程添加引用(AddReference)在Browse中添加刚才靠过来的CKEditor.NET.dll文件

4.将压缩包中的_Sample的ckeditor文件夹拷贝到工程文件下。

5.在aspx网页中注册CKEditor插件:

第一种一种方式是在单个网页的顶部添加下面的语句如果要在单个网页中使用该插件则在该网页到最上面添加

<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%> 

第二种方式是在整个工程的Web.config文件的

<system.web><pages><controls>中添加<add tagPrefix="CKEditor" assembly="CKEditor.NET" namespace="CKEditor.NET"/>

6.然后在网页中需要使用到插件的地方添加

<CKEditor:CKEditorControl ID="id" BasePath="~/ckeditor" runat="server"></CKEditor:CKEditorControl>

7.效果图 下面部分是我用laber接受从CKEditor.Text获得的内容

原文地址:https://www.cnblogs.com/hyk110988/p/3645373.html