MVC配置ckeditor+ckfinder
ckeditor当前使用版本:4.5.8
ckfinder当前使用版本:2.6.0
1.Ckeditor配置简单,直接使用Nuget下载就可

2.下载ckfinder
https://cksource.com/ckfinder/download
选择Asp.net版本下载并放在相同的目录下:‘Scripts'
3.添加js引用:
@Scripts.Render("~/Scripts/ckeditor/ckeditor.js")
@Scripts.Render("~/Scripts/ckfinder/ckfinder.js")
4.配置:
打开ckeditor目录下config.js文件如下配置:
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.height = ;
config.skin = 'office2013';
config.filebrowserBrowseUrl = '/Scripts/ckfinder/ckfinder.html'; //上传文件时浏览服务文件夹
config.filebrowserImageBrowseUrl = '/Scripts/ckfinder/ckfinder.html?Type=Images'; //上传图片时浏览服务文件夹
config.filebrowserFlashBrowseUrl = '/Scripts/ckfinder/ckfinder.html?Type=Flash'; //上传Flash时浏览服务文件夹
config.filebrowserUploadUrl = '/Scripts/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files'; //上传文件按钮(标签)
config.filebrowserImageUploadUrl = '/Scripts/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images'; //上传图片按钮(标签)
config.filebrowserFlashUploadUrl = '/Scripts/ckfinder/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'; //上传Flash按钮(标签)
};
打开ckfinder目录下的config.ascx文件配置两个地方
public override 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 on your system. // return HttpContext.Current.User.Identity.IsAuthenticated; //登陆用户才能上传
return true;
}
public override void SetConfig()
{
// 上传文件的目录,这个目录必须有访问权限如:
BaseUrl = "/Content/userfiles/";
5.把ckfinder目录中bin文件,复制到mvc项目中的bin目录中(好处是不用添加引用)
6.测试:
显示一个<textarea>
<div class="form-group">
@Html.LabelFor(model => model.Content, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextAreaFor(model => model.Content, , , htmlAttributes:new { @class = "ckeditor"})
@Html.ValidationMessageFor(model => model.Content, "", new { @class = "text-danger" })
</div>
</div>


MVC配置ckeditor+ckfinder的更多相关文章
- ci 配置ckeditor + ckfinder 无图片上传按钮
一:配置路径有问题 {$base_url}assets/js/editor/ckfinder/ckfinder.html --> http://www.cnblogs.com/assets/j ...
- 网络编辑器插件ckeditor+ckfinder配置
原帖地址 另外一个 去掉编辑器的下边栏 在config.js中加入: config.removePlugins = 'elementspath'; config.resize_enabled = fa ...
- (配置)CKEditor+CKFinder+php上传配置,根据年月命名创建文件夹来存放
CKEditor+CKFinder+php上传配置 新版本的CKEditor只提供了基本的文本编辑功能,上传模块由另一个组件CKFinder.这里主要记录CKFinder上传的一些参数配置,能够成功上 ...
- CKEditor + CKFinder 实现编辑上传图片配置 (二)
CKEditor + CKFinder 实现编辑上传图片配置 (二) 上传图片时,如果上传的图片过大,默认情况情况下回自动裁剪,代码如图 \ckfinder\config.php 目录下的配置文件co ...
- Drupal 7 配置ckeditor和ckfinder编辑器实现图片上传--不用wysisyg
注意: 1.这里的ckeditor编辑器是独立模块,不是那个wysiwyg模块. 2.这里的图片上传仅仅为文章内图片,非字段图片. 1.下载文件(1) http://drupal.org/proj ...
- CKEditor && CKFinder 配置
准备 ...
- CKEditor + CKFinder 实现编辑上传图片配置
下载最新版 ckfinder 本人下载的php版本 https://cksource.com/ckfinder/download 下载最新版ckeditor http://ckeditor.com/ ...
- jsp中如何整合CKEditor+CKFinder实现文件上传
最近笔者做了一个新闻发布平台,放弃了之前的FCKEditor编辑器,使用了CKEditor+CKFinder,虽然免费的CKFinder是Demo版本,但是功能完整,而且用户都是比较集中精神发新闻的人 ...
- 在ASP.NET项目中使用CKEditor +CKFinder实现图片上传功能
前言 之前的项目中一直使用的是FCKeditor,昨天突然有个想法:为什么不试一下新的CKEditor呢?于是花了大半天的时间去学习它的用法,现在把我的学习过程与大家分享一下. 谈起FCKeditor ...
随机推荐
- UILabel笔记(待完善)
UIlabel的换行由 numberOfLines 属性控制,当为0时,则会自动换到适合的行数: 换行的模式由 lineBreakMode 属性控制: public enum NSLineBreakM ...
- Persistent Data Structures
原文链接:http://www.codeproject.com/Articles/9680/Persistent-Data-Structures Introduction When you hear ...
- C# DataTable分页处理
有时候我们从数据库获取的数据量太大,而我们不需要一次性显示那么多的时候,我们就要对数据进行分页处理了,让每页显示不同的数据. public DataTable GetPagedTable(DataTa ...
- Sublime Text 2 JS 格式化插件 JsFormat的配置使用
(转自http://www.jb51.net/softjc/178401.html) 这里下载这插件包 https://github.com/jdc0589/JsFormat ,点油下角的zip就能下 ...
- 弱网测试Android
弱网测试一般是指模拟在网络环境比较差的情况下,检测APP是否有异常,如崩溃,数据收发出现丢包的情况 一.首先需要控制网络,有两种方式其一使用网络损伤仪进行,其二采用软件方式.硬件采购费用太贵,因此使用 ...
- 数据结构作业之用队列实现的基数排序(Java版)
题目: 利用队列实现对某一个数据序列的排序(采用基数排序),其中对数据序列的数据(第1和第2条进行说明)和队列的存储方式(第3条进行说明)有如下的要求: 1)当数据序列是整数类型的数据的时候,数据序列 ...
- sql server 删除表及表的相关视图、存储过程、方法
注意:进行此操作前需先备份数据库,免得删错无法恢复 1.查询 SELECT Name ,type FROM SysObjects WHERE name LIKE '%cases%' 2.拼接语句 SE ...
- Instsrv.exe和Srvany.exe的使用方法
要把应用程序添加为服务,你需要两个小软件:Instsrv.exe和Srvany.exe.Instsrv.exe可以给系统安装和删除服务,Srvany.exe可以让程序以服务的方式运行.这两个软件都包含 ...
- H5唤起APP一些坑
$(function () { function _openAppUrl(appUrl){ var ua = navigator.userAgent.toLocaleLowerCase(), open ...
- linux 监测函数
http://www.ttlsa.com/linux/the-nethogs-view-each-process-uses-bandwidth/ Linux的IO性能监控工具iostat详解 http ...