您的位置:首页 > 编程语言 > ASP

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

2013-05-09 01:04 537 查看
一、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截图:



注:这里介绍的两个编辑器使用的版本都比较老,新版本可能会有出入,使用时请注意!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐