.net百度编辑器的使用
1.前端引用
<%@ Page ValidateRequest="false" Language="C#" AutoEventWireup="true" CodeBehind="ProductsAdd.aspx.cs" Inherits="Maticsoft.Web.Manager.ProductsAdd" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="utf8-net/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="utf8-net/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="utf8-net/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript"> //实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
var ue = UE.getEditor('txtEditorContents');
</script>
<script type="text/javascript">
function previewFile() {
var preview = document.querySelector('img');
var file = document.querySelector('input[type=file]').files[0];
var reader = new FileReader();
reader.onloadend = function () {
preview.src = reader.result;
}
if (file) {
reader.readAsDataURL(file);
} else {
preview.src = "";
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="place">
<span>位置:</span>
<ul class="placeul">
<li><a href="#">首页</a></li>
<li><a href="#">表单</a></li>
</ul>
</div>
<div class="formbody">
<div class="formtitle"><span>基本信息</span></div>
<ul class="forminfo">
<li>
<label>商品名</label><input name="txt_name" type="text" class="dfinput" runat="server" id="txt_name" />
</li>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="商品名不能为空!" ControlToValidate="txt_name" ForeColor="Red"></asp:RequiredFieldValidator>
<li>
<label>商品分类</label>
<asp:DropDownList ID="DropDownList2" runat="server" Height="29px" Width="193px">
</asp:DropDownList>
</li>
<li>
<label>商品单价</label><input name="txt_name" type="text" class="dfinput" runat="server" id="Text2" /> </li>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="价格不能为空!" ControlToValidate="Text2" ForeColor="Red"></asp:RequiredFieldValidator> <li>
<label>批发价</label><input name="txt_name" type="text" class="dfinput" runat="server" id="Text3" />
</li>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="价格不能为空!" ControlToValidate="Text3" ForeColor="Red"></asp:RequiredFieldValidator>
<li>
<label>单位</label><input name="txt_name" type="text" class="dfinput" runat="server" id="Text1" />
</li>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="单位不能为空!" ControlToValidate="Text1" ForeColor="Red"></asp:RequiredFieldValidator>
<%-- <li>
<label>商品介绍</label><textarea name="txta" style="width: 499px; height: 41px" id="Textarea4" runat="server"></textarea>
</li>--%>
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="商品介绍不能为空!" ControlToValidate="Textarea4"></asp:RequiredFieldValidator>--%>
<li>
<label>商品图片</label><asp:FileUpload ID="FileUpload" runat="server" onchange="previewFile()" />
<asp:Image ID="preview" runat="server" Height="42px" Width="46px" />
</li>
<li>
<label>备注</label><textarea name="txta1" style="width: 479px; height: 41px" id="Textarea1" runat="server"></textarea>
</li>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="备注不能为空!" ControlToValidate="Textarea1" ForeColor="Red"></asp:RequiredFieldValidator>
<li>
<label>销量</label>
<asp:TextBox ID="TextBox1" runat="server" CssClass="dfinput"></asp:TextBox>
</li>
<li>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="销量不能为空!" ControlToValidate="TextBox1" ForeColor="Red"></asp:RequiredFieldValidator>
</li>
<li>
<label>是否热门</label>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="1">热销</asp:ListItem>
<asp:ListItem Value="0">不热销</asp:ListItem>
</asp:DropDownList>
</li>
<li>
<label>推荐</label>
<asp:DropDownList ID="DropDownList3" runat="server">
<asp:ListItem Value="1">推荐</asp:ListItem>
<asp:ListItem Value="0">不推荐</asp:ListItem>
</asp:DropDownList>
</li> <li>
<label>新品</label>
<asp:DropDownList ID="DropDownList4" runat="server">
<asp:ListItem Value="1">新品</asp:ListItem>
<asp:ListItem Value="0">不是新品</asp:ListItem>
</asp:DropDownList>
</li>
<li>
<label>优惠</label>
<asp:DropDownList ID="DropDownList5" runat="server">
<asp:ListItem Value="1">优惠</asp:ListItem>
<asp:ListItem Value="0">不优惠</asp:ListItem>
</asp:DropDownList>
</li>
<li>
<label>轮播图</label>
<asp:DropDownList ID="DropDownList6" runat="server">
<asp:ListItem Value="1">宣传</asp:ListItem>
<asp:ListItem Value="0">不宣传</asp:ListItem>
</asp:DropDownList>
</li>
<li>
<label>是否下架</label>
<asp:DropDownList ID="DropDownList7" runat="server">
<asp:ListItem Value="0">否</asp:ListItem>
<asp:ListItem Value="1">是</asp:ListItem>
</asp:DropDownList>
</li>
<li>
<label>颜色</label>
<asp:TextBox ID="TextBox2" runat="server" CssClass="dfinput" placeholder="颜色要以逗号分隔开比如:黄,红" Height="28px" Width="378px"></asp:TextBox>
</li>
<li>
<asp:TextBox ID="txtEditorContents" name="txtEditorContents" runat="server" TextMode="MultiLine" Height="200px" Width="1000px" ClientIDMode="Static "> </asp:TextBox><asp:Button ID="btn_add" runat="server" Text="确认添加" CssClass="btn" OnClick="btn_add_Click" Height="39px" Width="121px" OnClientClick="getcked()" />
</li> </ul> </div>
</form>
</body>
</html>
2.后台赋值
model.P_text = txtEditorContents.Text;
下载地址:链接:https://pan.baidu.com/s/1pJmEsR2LUJCljkNBuqabpA 密码:0r18
.net百度编辑器的使用的更多相关文章
- 一步步开发自己的博客 .NET版(4、文章发布功能)百度编辑器
前言 这次开发的博客主要功能或特点: 第一:可以兼容各终端,特别是手机端. 第二:到时会用到大量html5,炫啊. 第三:导入博客园的精华文章,并做分类.(不要封我) 第四:做个插件,任何网站上的技术 ...
- 关于百度编辑器UEditor的一点说明
大家在使用的时候要特别注意editor_config.js中的“URL”这个参数 我的理解:1.这个参数是editor整个结构的总路径 2.首先要把这个路径配置好了.才能正常的显示, ...
- 百度编辑器ueditor插入表格没有边框颜色的解决方法
附:从word excel 中 复制的表格提交后无边框,参考这个同学的,写的很详细: http://blog.csdn.net/lovelyelfpop/article/details/51678 ...
- 百度编辑器UEditor的使用方法
百度编辑器具有丰富文本编辑功能,且开源免费,其使用方法如下: 1.在官网上下载对应的Uditor压缩包:http://ueditor.baidu.com/website/download.html 2 ...
- 百度编辑器ueditor插入表格没有边框,没有颜色的解决方法 2015-01-06 09:24 98人阅读 评论(0) 收藏
百度富文本编辑器..很强大.. - - ,不过有些BUG..真的很无解.. 最近用这个,发现上传的表格全部没有表框.. 解决办法如下: 转载的.. 百度编辑器ueditor插入一个表格后,在编辑过程中 ...
- UEditor百度编辑器,工具栏上自定义添加一个普通按钮
添加一个名叫“hougelou”的普通按钮在工具栏上: 第一步:找到ueditor.config.js文件中的toolbars数组,增加一个“hougelou”字符串,然后找到labelMap数组,对 ...
- 百度编辑器 ueditor 内容编辑自动套P标签,及p标签 替换
如图,红框为回车键和shift+回车 : ===>> ueditor.all.js中: 1: 搜索修改成false:allowDivTransToP: false 再搜索并修改以下 ...
- 百度编辑器ueditor 异步加载时,初始化没办法赋值bug解决方法
百度编辑器ueditor 异步加载时,初始化没办法赋值bug解决方法 金刚 前端 ueditor 初始化 因项目中使用了百度编辑器——ueditor.整体来说性能还不错. 发现问题 我在做一个编辑页面 ...
- yii2解决百度编辑器umeditor图片上传问题
作者:白狼 出处:http://www.manks.top/article/yii2_umeditor_upload本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原 ...
- yii2整合百度编辑器umeditor
作者:白狼 出处:www.manks.top/article/yii2_umeditor 本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责 ...
随机推荐
- [转]RPC 框架通俗介绍
关于RPC 你的题目是RPC(远程过程调用,Remote Procedure Call)框架,首先了解什么叫RPC,为什么要RPC,RPC是指远程过程调用,也就是说两台服务器A,B,一个应用部署在A服 ...
- 用 .gitlab-ci.yml 配置 gitlab 的任务(job)
官方说明:https://docs.gitlab.com/ee/ci/yaml/
- 五、springboot(二)配置数据源oracle
1.添加依赖 <!-- jpa --> <dependency> <groupId>org.springframework.boot</groupId> ...
- Uedit编辑器编辑Velocity
1.切换到源代码模式 UM.getEditor('editor').execCommand("source"); 2.给编辑器插入Velocity源码 $(".edui- ...
- php统计中英文混合的文章字数
function ccStrLen($str) #计算中英文混合字符串的长度 { $ccLen=0; $ascLen=strlen($str); $ind=0; $hasCC=ereg("[ ...
- Vivado约束文件(XDC)的探究(1)
Vivado约束文件(XDC)的探究(1) 工程建好之后会出现xdc文件: 注意:active 和 target 生成的约束文件如下:
- Vivado HLS初识---阅读《vivado design suite tutorial-high-level synthesis》(5)
Vivado HLS初识---阅读<vivado design suite tutorial-high-level synthesis>(5) 1.创建工程 启动vidado HLS co ...
- 怎样在Qsys系统中添加第三方IP核
1.新建Quartus II工程 2.新建Qsys系统 3.如果没有我们需要添加的IP,需要自己额外添加 4在我们新建的Quartus工程里面新建一个文件夹,命名为ip; 5.将我们已经下载好的IP文 ...
- 让Netbeans 8.0 支持 Python 编程
发布人 admin. 分类 Python, 技术手札 Netbeans版本:Netbeans 8.0 for PHP Python版本:python 2.7.8 1.添加插件更新中心 打开Netbea ...
- 关于Dubbo面试问题
一.默认使用的是什么通信框架,还有别的选择吗? 默认也推荐使用netty框架,还有mina. 二.服务调用是阻塞的吗? 默认是阻塞的,可以异步调用,没有返回值的可以这么做. 三.一般使用什么注册中心? ...