简单贴出代码,可以下载
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>UEditor非控件渲染示例</title>
<link rel="stylesheet" type="text/css" href="/UEditor/themes/default/ueditor.css" />
<script src="/UEditor/editor_config.js" type="text/javascript"></script>
<script src="/UEditor/editor_all.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<fieldset>
<legend>获取内容操作</legend>
<input id="Button1" type="button" value="JS获取第一个编辑器内容" onclick="alert(UEditor1.getContent())" />
<asp:Button ID="Button2" runat="server" Text="后台获取第一个编辑器内容" OnClick="Button2_Click" />
<input id="Button3" type="button" value="JS获取第二个编辑器内容" onclick="alert(UEditor2.getContent())" />
<asp:Button ID="Button4" runat="server" Text="后台获取第二个编辑器内容" OnClick="Button4_Click" />
</fieldset>
<fieldset>
<legend>后台获取到的HTML内容</legend>
<div id="divHtml" runat="server">
</div>
</fieldset>
<br />
<fieldset style=" height:300px;">
<legend>第一个编辑器</legend>
<textarea name="UEditor1" id="UEditor1" rows="4" cols="40" wrap="virtual"></textarea>
<script type="text/javascript">
var option = {};
var UEditor1 = new baidu.editor.ui.Editor(option);
UEditor1.render('UEditor1');
</script>
</fieldset>
<fieldset style=" height:200px;">
<legend>第二个编辑器</legend>
<textarea name="UEditor2" id="UEditor2" rows="4" cols="40" wrap="virtual"></textarea>
<script type="text/javascript">
var option = {minFrameHeight:100};
var UEditor2 = new baidu.editor.ui.Editor(option);
UEditor2.render('UEditor2');
</script>
</fieldset>
</form>
</body>
</html>
protected void Button2_Click(object sender, EventArgs e)
{
divHtml.InnerHtml = Request.Form["UEditor1"];
}
protected void Button4_Click(object sender, EventArgs e)
{
divHtml.InnerHtml = Request.Form["UEditor2"];
}
评论列表: