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标签,输入到页面也可以执行,但是我再次编辑 ...
随机推荐
- MySQL主从读写分离专题
主机A:192.168.1.101从机B:192.168.1.102 1.先登录主机 Amysql>GRANT REPLICATION SLAVE ON *.* TO slave_user@19 ...
- 微信浏览器如何禁止iPhone手机上下滑动网页
代码: /*去掉iphone手机滑动默认行为*/ $('body').on('touchmove', function (event) { event.preventDefault(); });
- 【剑指offer】递归循环两种方式反转链表
转载请注明出处:http://blog.csdn.net/ns_code/article/details/25737023 本文分别用非递归和递归两种方式实现了链表的反转,在九度OJ上AC. 题目描写 ...
- [MongoDB] Insert, find -- 1
MongoDB is JSON Document: How to start MongoDB client: mongod //start the server mongo // start the ...
- [MEAN Stack] First API -- 3. Select by ID with Mongoose and Express
Mongoose allows you to easily select resources by ID from your MongoDB. This is an important aspect ...
- Android 动画机制与使用技巧
动画效果一直是人机交互中非常重要的部分,与死板.突兀的显示效果不同,动画效果的加入,让交互变得更加友好,特别是在提示.引导类的场景中,合理地使用动画能让用户获得更加愉悦的使用体验 一.Android ...
- iOS开发——网络实用技术OC篇&网络爬虫-使用java语言抓取网络数据
网络爬虫-使用java语言抓取网络数据 前提:熟悉java语法(能看懂就行) 准备阶段:从网页中获取html代码 实战阶段:将对应的html代码使用java语言解析出来,最后保存到plist文件 上一 ...
- [CodeEdit--Sublime]一些好用的Plugins
Sublime Text 3 Plugins (**)packet control:plugin包管理器 (**)netuts-fetch: (**)markdown editing:Markdown ...
- mysql常用命令大全 mysql常用命令总结
原文地址:http://www.jbxue.com/db/12472.html 本文介绍下,mysql中常用的一些命令,包括创建与修改数据库.数据库中的表,mysql的权限管理命令grant.revo ...
- 解决ajax.net 1.0中文乱码问题!
在使用ajax.net的UpdatePanel的时候,当requestEncoding编码为GB2312的时候,出现乱码.如果要解决这个问题最简单的就是改用utf-8了,但是原来使用GB2312, ...