1.HTML页面如下代码
<ext:resourcemanager id="ResourceManager1" runat="server">
</ext:resourcemanager> <ext:panel id="Panel1" runat="server" title="" frame="true" layout="Fit" buttonalign="Center" autoheight="true"> <Buttons> <ext:Button ID="Button1" runat="server" Icon="DiskEdit" Text="保 存" > <DirectEvents> <Click OnEvent="Button1_DirectClick"> <ExtraParams> <ext:Parameter Name="myGetEditor" Mode="Raw" Value="getEditText()" /> </ExtraParams> </Click> </DirectEvents> </ext:Button> <ext:Button ID="Button2" runat="server" Icon="Cancel" Text="关 闭"> <Listeners> <Click Handler="parent.window.tmpWin.close();" /> </Listeners> </ext:Button> </Buttons> <Items> <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Frame="true" DeferredRender="false" AutoHeight="true"> <Items> <ext:Panel ID="Panel2" runat="server" Title="获取编辑器信息" Frame="true" AutoHeight="true" Padding="6" ItemCls="blueborder" Layout="Form"> <Items> <ext:TextArea runat="server" id="tbEditor" /> </Items> </ext:Panel> </Items> </ext:TabPanel> </Items> </ext:panel> </div> </form> <script type="text/javascript"> var editor; Ext.onReady(function () {editor = new baidu.editor.ui.Editor({
iframeCssUrl: '/Editors/ueditor/themes/default/iframe.css', textarea: 'myEditor' }); editor.render("tbEditor");})
var getEditText = function () { return editor.getContent(); }</script>
2.后台获取的事件:
protected void Button1_DirectClick(object sender, Ext.Net.DirectEventArgs e)
{string 编辑器内容 = e.ExtraParams["myGetEditor"].ToString();
}