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>


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

posted @ 2013-04-10 00:16  左正  阅读(3044)  评论(0编辑  收藏  举报