ckeditor值的获取

如果页面上没有

 <asp:ScriptManager ID="Scriptmanager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            </ContentTemplate>
        </asp:UpdatePanel>

那么后台可以通过txtcontent.Text获取ckeditor的值。

如果有了的话,后台通过txtcontent.Text就获取不到了。

js中获取ckeditor值的方法,  var editor = CKEDITOR.replace('txtContent');

 var content = editor.document.getBody().getHtml();

设置ckeditor值的方法

   editor.document.getBody().setHtml(content);

posted @ 2015-01-12 11:29  杨博客  阅读(1270)  评论(0编辑  收藏  举报