ASP.NET下在线编辑器FreeTextBox与FCKeditor快速使用

一、FreeTextBox(版本3.2.1)

1、下载FreeTextBox,等到对应 .Net 的版本FreeTextBox.dll;

2、将FreeTextBox.dll复制到项目的bin文件下;

3、右键“引用”->”添加引用“->"浏览",找着FreeTextBox.dll,确定引用FreeTextBox.dll;

4、新建一个aspx页面,先注册一下控件,代码如下(加在@ Page之后):

<%@ Register Assembly="FreeTextBox" Namespace="FreeTextBoxControls" TagPrefix="FTB" %>
5、引用控件的html代码:

<FTB:FreeTextBox Text="" Language="zh-CN" ToolbarStyleConfiguration="OfficeMac"  ID="ftbContent" Width="100%" Height="300px" runat="server">
</FTB:FreeTextBox>
6、后端页面控件使用代码如下:

ftbContent.Text = "<p>wnaghengheng</p>";
string result = ftbContent.Text;

二、FCKeditor(版本2.2)

1、下载FCKeditor2.4.2.zip和   FCKeditor.NET版的2个zip包,解压得到FCKeditor文件夹及FredCK.FCKeditorV2.dll;

2、将FredCK.FCKeditorV2.dll复制到项目的bin文件下,FCKeditor文件夹复制到项目根目录下,并在项目根目录新建Files文件夹用来存放FCKeditor上传的文件;

3、右键“引用”->”添加引用“->"浏览",找着FredCK.FCKeditorV2.dll,确定引用FredCK.FCKeditorV2.dll;

4、打开项目web.config,在<appSettings>节点下添加以下三项:

    <add key="FCKeditor:BasePath" value="~/FCKeditor/"/>
    <add key="FCKeditor:UserFilesPath" value="~/Files/"/>
    <add key="FCKeditor:UploadDeniedExtensions" value=".php|.php3|.php5|.phtml|.asp|.aspx|.ascx|.jsp|.cfm|.cfc|.pl|.bat|.exe|.dll|.reg|.cgi|.cs|.vb|.asa|.cer|c.dx|.ascx|.asax|.ashx|.asmx|.java|.jsl"/>
5、新建一个aspx页面,先注册一下控件,代码如下(加在@ Page之后):

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
6、引用控件的html代码:

<FCKeditorV2:FCKeditor  id="txtBody" runat="server" BasePath="~/FCKeditor/" Width="100%" ToolbarStartExpanded="false" Height="380px">
</FCKeditorV2:FCKeditor>
7、后端页面控件使用代码如下:

txtBody.Value = "<p>wnaghengheng</p>";
string result = txtBody.Value;

三、使用效果

FreeTextBox截图:

FCKeditor截图:

注:这里介绍的两个编辑器使用的版本都比较老,新版本可能会有出入,使用时请注意!


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值