MVC4 使用 ckfinder+ckeditor编辑器
配置ckfinder for asp.net 版本下载地址 http://cksource.com/ckfinder/downloadckeditor下载地址 http://ckeditor.com/download
config.ascx
public override bool CheckAuthentication()
{ return true; 设置为true
}
config.filebrowserBrowseUrl = '/ckfinder/ckfinder.html'; //不要写成"~/ckfinder/..."或者"/ckfinder/..."
config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?Type=Images';
config.filebrowserFlashBrowseUrl = '/ckfinder/ckfinder.html?Type=Flash';
config.filebrowserUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files';
config.filebrowserImageUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images';
config.filebrowserFlashUploadUrl = '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash';
config.filebrowserWindowWidth = '800'; //“浏览服务器”弹出框的size设置 config.filebrowserWindowHeight = '500'; }
View
引用JS
<script src="../../ckeditor/ckeditor.js"></script>
<script src="../../ckfinder/ckfinder.js"></script>
<script src="../../Scripts/jquery-1.8.2.js"></script> <div>
<textarea name="TextArea1" cols="20" rows="2" class="ckeditor">@ViewBag.content</textarea>//新增
<textarea name="TextArea1" cols="20" rows="2" class="ckeditor">@Model.Content</textarea>//编辑 </div>
<p>
<input type="submit" value="添加" />
</p>
<script type="text/javascript">
$(function () {
var editor = CKEDITOR.replace("TextArea1", { "toolbar": "Basic" }); //显示编辑器
CKEDITOR.replace('TextArea1');
var editor = CKEDITOR.replace('TextArea1');
CKFinder.SetupCKEditor(editor, '/ckfinder/'); })
</script>
Controller
[HttpPost]
[ValidateInput(false)] //设置避免出现 检测到有潜在危险的 Request.Form public ActionResult Edit(int id, FormCollection collection)
{
var content = collection["TextArea1"];
var userinfo = db.userinfo.Find(id);
userinfo.img = img;
db.SaveChanges();return RedirectToAction("Index"); }
MVC4 使用 ckfinder+ckeditor编辑器的更多相关文章
- ckeditor编辑器在java项目中配置
一.基本使用: 1.所需文件架包 A. Ckeditor基本文件包,比如:ckeditor_3.6.2.zip 下载地址:http://ckeditor.com/download 2.配置使用 A.将 ...
- asp.net mvc4使用百度ueditor编辑器
原文 http://www.cnblogs.com/flykai/p/3285307.html 已测试 相当不错 前言 配置.net mvc4项目使用ueditor编辑器,在配置过程中遇见了好 ...
- javascript获取ckeditor编辑器的值(实现代码)
CKeditor编辑器是FCKeditor的升级版本想对于FCK来说,确实比较好用,加载速度也比较快以下是如果通过JS获取CKeditor编辑器的值,用于表单验证 if(CKEDITOR.instan ...
- 关于wordpress中更换CKEditor编辑器
wordpress中自带的编辑器实在是功能太简,连插入表格都没有,使用插件的方式太过于麻烦,干脆就直接更换编辑器了,在网上找了一些方法,下文引自http://down.chinaz.com/try/2 ...
- [转载] ASP.NET MVC4使用百度UEDITOR编辑器
前言 配置.net mvc4项目使用ueditor编辑器,在配置过程中遇见了好几个问题,以此来记录解决办法.编辑器可以到http://ueditor.baidu.com/website/downloa ...
- mvc4使用百度ueditor编辑器
前言 配置.net mvc4项目使用ueditor编辑器,在配置过程中遇见了好几个问题,以此来记录解决办法.编辑器可以到http://ueditor.baidu.com/website/downloa ...
- 升级phpcms的ckeditor编辑器
首先说明一下为什么升级?网上很多人升级成了ueditor,可从fckedotror 到 ckeditor,我个人都是比较喜欢的,特别是开放式的插件方式.另外一个就是至少要懂得升级和插件的开发,这样也能 ...
- 如何将CKeditor编辑器的上传和thinkphp结合
转载:THINKPHP代码中 lxepoo的文章 有时候我们会发现,我们需要对上传文件进行日志记录,这样的记录通常写在LOG文件或数据库中,那么,通过TP本身的上传类,可以实现的,但是只能做到编辑器外 ...
- 解决Ckeditor编辑器不显示html实体,自动过滤html的问题
Ckeditor 4.5.4,在编辑的时候,使用源码编辑,当保存内容包含Javascript.Style标签的时候,数据库中有Javascript.Style标签,输入到页面也可以执行,但是我再次编辑 ...
随机推荐
- 【转】python代码风格-PEP8
转载自http://www.douban.com/note/134971609/ Python 的代码风格由 PEP 8 描述.这个文档描述了 Python 编程风格的方方面面.在遵守这个文档的条件下 ...
- hdu 5592 ZYB's Game 树状数组
ZYB's Game Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=55 ...
- Codeforces Round #307 (Div. 2) B. ZgukistringZ 暴力
B. ZgukistringZ Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/551/probl ...
- C#封装、多态、抽象、接口、匿名方法等学习
1:封装 将对象进行封装,并不等于将整个对象完全包裹起来,而是根据实际需要,设置一定的访问权限,用户根据不同的权限调用对象提供的功能,在C#语言中,可以使用修饰符public.internal.pro ...
- Java学习笔记(4)——JavaSE
一.HashMap HashMap以键值对的形式存储对象,关键字Key是唯一的,不重复的 1,key可以是任何对象,Value可以任何对象 2,重复的key算一个,重复添加是替换操作(会覆盖原来的元素 ...
- [Angular 2] Set Properties on Dynamically Created Angular 2 Components
When you generate Angular 2 components, you’re still able to access the component instance to set pr ...
- oc-32-@property示例
Goods.h #import <Foundation/Foundation.h> typedef struct{ int year; int month; int day; } MyDa ...
- php内核探索
http://www.nowamagic.net/librarys/veda/special/PHP%E5%86%85%E6%A0%B8%E6%8E%A2%E7%B4%A2 关注PHP 源代码 Zen ...
- Win7 IE故障:APPCRASH,d3d9.dll,c0000005
问题: 今天使用使用IE登录某网址,发现总是报错,如下图,无法浏览. 解决方案: 主要讲IE的呈现方案修改即可,如下步骤: 在IE的[Intern ...
- Oracle中关于清除数据和释放表空间
一.表的重命名 flashback table test2 to before drop rename to test3;--[to test3]将表重命名 drop table test3 purg ...