FCKeditor在.net(asp.net)中的使用方法
来源:互联网 发布:美国人工智能机器人 编辑:程序博客网 时间:2024/05/19 13:07
安装前需求:
1.FCKeditor.Net_2.5.zip
下载地址:
http://downloads.sourceforge.net/fckeditor/FCKeditor.Net_2.5.zip
2.FCKeditor_2.6.zip
下载地址:
http://sourceforge.net/project/downloading.php?group_id=75348&filename=FCKeditor_2.6.zip
一、安装过程:
1、将FCKeditor.Net_2.5.zip解压缩。我们需要一个DLL文件。在\bin\Release\文件夹下有两个版本。对应.netframework的版本,我的是.netframework2.0的,就在\bin\Release\2.0\下,拷贝FredCK.FCKeditorV2.dll至你的项目的bin目录。然后在.net的工具箱中添加此项。
2、将FCKeditor_2.6.zip解压缩。将所得的fckeditor文件夹拷贝至项目根目录。打开/fckeditor/fckconfig.js
找到:
var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
这两行,大致位置在271、272两行。
将这两行中的PHP替换为aspx。
找到:FCKeditor\filemanager\connectors\aspx\config.ascx
UserFilesPath = "/userfiles/";
这一行,大概在第50行处。将/userfiles/替换为你的用来存放用户上传文件的文件夹。
保存、退出。
3、在\fckeditor\editor\filemanager\connectors\aspx\文件夹下找到config.ascx用editplus或者文本文档打开,找到:
private bool CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
//
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.
return false;
}
这个函数的作用是根据用户类型判断用户是否有上传文件的权利。如果直接return true;则允许所有用户上传文件。建议在这个函数中判断用户类型,然后在根据判断结果来确定返回值。
修改好以后,保存、退出。
4、在你的项目的配置文件:web.config里找到<appSettings/>将它替换为:
<appSettings>
<add key="FCKeditor:UserFilesPath" value="/upload/" />
</appSettings>
把 value="/upload/" 替换为你的用来保存用户上传文件的文件夹。
如果web.config里没有<appSettings/>这一项,就直接把上面三行代码放到<configuration>里面</configuration>
注意:用来保存用户上传文件的文件夹必须存在,如果不存在,请自己建立。
二、使用方法:
可以直接在ASP.NET设计视图中使用此控件,就像你使用textbox一样简单,直接从工具箱拖到页面上即可。获取FCKeditor的编辑框中的值,可以用FCKeditor的value属性获取编辑框内的值,此数据为html代码。至此,整个安装、使用过程结束!
调试时报错:
鈥?WebSite1鈥濆簲鐢ㄧ▼搴忎腑鐨勬湇鍔″櫒閿欒 銆?hr width=100% size=1 color=silver>
HTTP 閿欒 404 - Not Found銆?/i>
找了很久才发现有个网友和我报错是一样的。
他提供的方法是在<FCKeditorV2:FCKeditor ID="txtContent" runat="server" Height="400px" Width="100%" BasePath="/FCKeditor/" ></FCKeditorV2:FCKeditor>
但是问题依然存在,因为报错一模一样,我想问题还是出在这里的,就继续研究,发现原来是目录夹的问题,将BasePath="~/FCKeditor/"问题解决,很漂亮的编辑界面,开源真好!
- FCKeditor在.net(asp.net)中的使用方法
- FCKeditor在.net(asp.net)中的使用方法
- Fckeditor在asp.net中的使用方法
- Fckeditor在asp.net(vs2008)中的使用方法
- FCKeditor(asp.net)使用方法
- FCKeditor 在ASP.Net 中的使用说明(翻译)
- FCKeditor 在ASP.Net 中的使用说明
- FCKeditor 在ASP.Net 中的使用说明
- FCKEditor 在ASP.NET中的使用
- FCKeditor 在ASP.Net 中的使用说明
- FCKEditor在ASP.NET中的使用
- FCKeditor 在ASP.Net 中的使用说明
- FCKeditor 在ASP.Net 中的使用说明
- FCKeditor在asp.net中的用法
- FCKeditor 在ASP.Net 中的使用说明
- FCKeditor 在ASP.Net 中的使用说明
- FCKeditor在Asp.Net中的配置
- FCKeditor在asp.net中的用法
- ASP.NET 2.0---Repeater控件
- SQL Express 2005里面没有SQL Server Management Studio管理器的解决办法
- 一个ASP.NET读写XML文件的示例
- 使用PageDataSource给Repeater、DataList增加分页
- 使用PagedDataSource类实现Repeater分页显示功能
- FCKeditor在.net(asp.net)中的使用方法
- ASP.NET中对字符串加密
- AS3操作XML添加节点
- upnp 端口映射
- AS3读取XML文件
- ActionScript 3.0系列教程(1):与Flash9先来一次亲密接触!
- AS 3.0教程(2):AS3.0的类及绑定
- AS3.0教程(3):Document Class特色为我们带来了什么?
- javaScript不同页面间传递参数