zoukankan      html  css  js  c++  java
  • ueditor赋值

    今天搞了好就终于找到一个解决办法:分享如下:
    我介绍的是从数据库赋值
    后台代码:
    this.lable1.Text = dr["字段名"].ToString();//对前台Id为lable的控件赋值
    前台代码:
    <asp:Label ID="editoraa" runat="server" Visible="false" Text=""></asp:Label>
    <script type="text/plain" id="editor"><%=this.editoraa.Text%></script>//此处获取lable控件的值
    <script type="text/javascript">
    var editor = new baidu.editor.ui.Editor({
    UEDITOR_HOME_URL: '',
    autoClearinitialContent: false,//点击编辑框的时候 值不会消失
    textarea: 'editorcontent'
    });
    editor.render('editor');
    </script>
    如果要取值的话在后台:string aa= Request.Params["editorcontent"].ToString();
    就OK!!!
    配置:在editor_config.js文件修改
    var tmp = window.location.pathname;
    //URL = window.UEDITOR_HOME_URL ¦¦ tmp.substr(0, tmp.lastIndexOf("\/") + 1).replace("_examples/", "").replace("website/", "");
    //这里你可以配置成ueditor目录在您网站的相对路径或者绝对路径(指以http开头的绝对路径)
    URL = "/UEditor/ueditor/";

    /**

    常见错误:从客户端(editorValue=”<p>欢迎使用ueditor!</p>”)中检测到有潜在危险的 Request.Form 值。
    解决方法:web.config文件
    <system.web>
    <pages validateRequest="false" theme="Default"/>
    <httpRuntime requestValidationMode="2.0" />
    </system.web>


    本人菜鸟一个, 老鸟们有好的方法 请赐教

  • 相关阅读:
    python-单链表的实现
    python-树形结构和遍历
    python四种简单排序
    python数据类型
    python安装和配置
    Js 中的false,零值,null,undefined和空字符串对象
    console和chrom-tool
    js中声明Number的五种方式
    vue下拉搜索
    canvas猜数游戏
  • 原文地址:https://www.cnblogs.com/soundcode/p/3011510.html
Copyright © 2011-2022 走看看