期货大赛项目|八,ueditor的应用
百度开发的富文本编辑器还是很不错的,可以已经不维护了
下载ueditor1_4_3_3-utf8-net放到项目中
找到net文件夹下config.json
修改以下两行
"imageUrlPrefix": "/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/net/", /* 图片访问路径前缀 */
"imagePathFormat": "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
imageUrlPrefix一定要找到自己放到的目录的net文件夹下
imagePathFormat就随意了 引入JS和CSS
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.config.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.all.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/lang/zh-cn/zh-cn.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.parse.js"></script>
html
<script id="container" name="content" type="text/plain">
</script>
完整页面
@using System.Web.Optimization
@{
ViewBag.Title = "Index";
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
@section css{
@Styles.Render("~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/themes/ueditorCss") }
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="page-title">
<div class="title_left">
<h3>内容编辑</h3>
</div>
</div>
<div class="clearfix"></div> <div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>大赛规则<small>编辑的内容将显示在前端的大赛规则中</small></h2> <div class="clearfix"></div>
</div>
<div class="x_content">
@* <div id="editor"> *@
@* </div> *@
<script id="container" name="content" type="text/plain">
</script>
<div class="ln_solid"></div>
<div class="form-group">
<button id="save" type="button" class="btn btn-success">保存</button>
</div>
</div>
</div>
</div> </div>
</div>
<!-- /page content -->
@section scripts{
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.config.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.all.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/lang/zh-cn/zh-cn.js"></script>
<script src="~/Content/vendors/ueditor1_4_3_3-utf8-net/utf8-net/ueditor.parse.js"></script>
<script src="~/Scripts/Admin/GameIntro/index.js"></script>
}
ue初始化
var ue = UE.getEditor("container", {
initialFrameHeight: 300
});
获取ue值
var content;
ue.ready(function () {
content = ue.getContent();
});
设置ue值
ue.ready(function() {
ue.setContent(data.data);
});
期货大赛项目|八,ueditor的应用的更多相关文章
- 期货大赛项目|四,MVC的数据验证
上图先看下效果 样式先不说,先了解下数据验证是怎么实现的 一 必须是强类型的视图 二 这些显示提示的话语,都在强类型的实体中 三 必须使用Html.BeginForm或者Html.AjaxBeginF ...
- 期货大赛项目|十,MVC对js和css的压缩
在Global.asax中添加两行代码 //默认在调试期间,不会启用js和css的压缩 //下面的语句确保了在调试期间也压缩css和js BundleTable.EnableOptimizations ...
- 期货大赛项目|六,iCheck漂亮的复选框
废话不多说,直接上图 对,还是上篇文章的图,这次我们不研究datatables,而是看这个复选框,比平常的复选框漂亮太多 看看我是如何实现的吧 插件叫iCheck 用法也简单 引入js和css $(& ...
- 期货大赛项目|九,fileinput插件的应用
引入JS和CSS bundles.Add(new ScriptBundle("~/bundles/fileinputJs").Include( "~/Content/ve ...
- 期货大赛项目|五,表格插件datatatables在MVC中的应用
系统中都需要表格,我见过最好的表格就是Datatables了,但中文文档有限,英文能力有限,就写一些简单用法 上图看效果先 要了分页和排序 基本用法 引入js和css bundles.Add(new ...
- 期货大赛项目|三,autofac简单用法
autofac是依赖注入 我们以前要引入一个dal层,是这么写的 private IDal _dao = new Dal() 我们可以看得出,这样写,我们的bll层不光依赖了接口IDal,还依赖了Da ...
- 期货大赛项目|二,DAL详解
接口层就不重点讲述了,直接DAL层 DAL层 using System; using System.Collections.Generic; using System.Linq; using Syst ...
- Java Web项目 配置 ueditor心得
近期的JAVA项目,由于客户要求需要引入富文本编辑器. 参考了两款插件,一款是ckeditor,一款是ueditor. ckeditor在上传文件的时候必须配合ckfinder使用,而ckfinder ...
- ssm项目中ueditor富文本编辑器的使用
一.下载 https://ueditor.baidu.com/website/index.html 将ueditor放到项目中合适的位置 二 . 配置文件上传路径 在utf8-jsp/jsp/conf ...
随机推荐
- 使用lombok自动生成链式调用
本文转载:使用 Lombok 自动生成 Getter and Setter
- Lodop打印控件在页面如何使用
Lodop打印控件部署到web服务器简单,在页面的使用方法也简单,是非常容易和方便使用的打印控件.客户端本地打印角色(即用户访问网站后 用自己链接的打印机进行客户端本地打印),步骤很少,部署简单:Lo ...
- macOS卸载应用不彻底
总觉得macOS卸载应用时直接移到废纸篓卸载不干净.配置文件根据Unix的习惯应该存放在用户目录下,还需要删除这些文件. ~/Library/Application Support/(应用程序名称) ...
- gprof性能测试工具
1.编译时加-pg选项,例如:gcc -pg test.c-o test_gprof.其中test后的_gprof一定要加上.会生成gmon.out. 2.运行程序.gprof test_gprof ...
- Ubuntu16.04 安装g++6
https://blog.csdn.net/qq_34877350/article/details/81182022 1.安装gcc-6: sudo apt-get update && ...
- django系列7:修改404页面展示,优化模板,降低urlconf和模板之间的耦合,命名app将模板和app绑定
为了增加程序的友好和健壮性,修改view代码,处理以下如果出现404,页面的UI展示. 修改view代码 from django.http import Http404 from django.sho ...
- Java IO流操作汇总: inputStream 和 outputStream【转】
我们在进行Android java 开发的时候,经常会遇到各种IO流操作.IO流操作一般分为两类:字符流和字节流.以“Reader”结尾都是字符流,操作的都是字符型的数据:以“Stream”结尾的都是 ...
- [再寄小读者之数学篇](2014-06-20 Beta 函数)
令 $\dps{B(m,n)=\sum_{k=0}^n C_n^k \cfrac{(-1)^k}{m+k+1}}$, $m,n\in\bbN^+$. (1) 证明 $B(m,n)=B(n,m)$; ( ...
- [物理学与PDEs]第3章习题6 Lagrange 坐标下的一维理想磁流体力学方程组的数学结构
试讨论 Lagrange 形式下的一维理想磁流体力学方程组 (5. 33)-(5. 39) 的类型. 解答: 由 (5. 33), (5. 39) 知 $$\bex 0=\cfrac{\p p}{\p ...
- Groovy 设计模式 -- 组合模式
Composite Pattern http://groovy-lang.org/design-patterns.html#_chain_of_responsibility_pattern 组合模式, ...