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>


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

  • 相关阅读:
    全国城市经纬度
    CentOS下SSH无密码登录的配置
    Nginx 1.9+PHP5.6 环境搭建
    Sphinx 2.2.11-release reference manual
    JVM 内存管理机制
    solr 3.5.0 与 tomcat 7.0.5 整合配置
    lucene 分词实现
    lucene 索引 demo
    lucene 搜索demo
    Lucene 简单API使用
  • 原文地址:https://www.cnblogs.com/soundcode/p/3011510.html
Copyright © 2011-2022 走看看