首页 > 设计 > WEB开发 > 正文

文本编辑器 前后台获取值

2019-11-02 18:22:38
字体:
来源:转载
供稿:网友

如图所示文本编辑器 这里写图片描述 1.添加js引用

<script src="../Content/assets/plugins/kindeditor/kindeditor-all-min.js"></script> <script src="../Content/assets/plugins/kindeditor/lang/zh_CN.js"></script>

2.textbox控件,控制行数

<asp:TextBox ID="txtRemark" runat="server" CSSClass="form-control ie_widthauto" Rows="10" Style="width: 700px; height: 500px;" TextMode="MultiLine"></asp:TextBox>

3.JQuery控制

var editor; KindEditor.ready(function (K) { editor = K.create('textarea[name="txtRemark"]', { allowFileManager: true, afterCreate: function () { var self = this; self.sync(); $("#spanddl").mouSEOver(function () { editor.sync(); }); } }); });

4.后台代码

1.赋值给数据库recepInfo.Remark = txtRemark.Text.Replace("<", "[").Replace(">", "]").Replace("&nbsp;", "");2.从数据库中获取值this.txtRemark.Text = recepInfo.Remark.Replace("[", "<").Replace("]", ">");
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表