CuteEditor v5 .Net and ajax

Last post 05-30-2006, 2:36 PM by Mr X. 2 replies.
Sort Posts: Previous Next
  •  11-07-2005, 8:47 PM 12354

    CuteEditor v5 .Net and ajax

    Thanks Adam for ealier comments - problem reolved.
     
    Does anybody know how to dynamically display and save content in CuteEditor .Net v5 using javascript?
     
    I tried the following code but does not work:

    Javascript  
    var x = Document.getElementById("Editor1");
    x.text = "Hello world";

    Aspx
    <%@ Register TagPrefix="ce" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <%@ Register TagPrefix="PHT" Namespace="PHT.Web.Common.Controls" Assembly="PHT.Web" %>
    <%@ Register TagPrefix="PHT" TagName="PageHeader" Src="./Common/Controls/PageHeader.ascx" %>
    <%@ Page language="c#" Codebehind="Visit.aspx.cs" AutoEventWireup="false" Inherits="PHT.Web.Visit" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    .....

        <div id="NotesSection">
           <CE:Editor id="Editor1" style="Z-INDEX: 101; LEFT: 1px; POSITION: absolute; TOP: 0px" runat="server"
            ConfigurationPath="~/CuteSoft_Client/CuteEditor/Configuration/mytools.config" AutoConfigure="None"
            Width="550px" Height="250px" ThemeType="Office2003" ShowHtmlMode="False" ShowCodeViewToolBar="False">
            <FrameStyle Height="100%" BorderWidth="1px" BorderStyle="Solid" BorderColor="#DDDDDD" Width="100%"
             CssClass="CuteEditorFrame" BackColor="White"></FrameStyle>
           </CE:Editor>
        </div>
    .......

    </HTML>




    Kind regards

    Bruce
     
     
  •  11-08-2005, 5:19 AM 12360 in reply to 12354

    Re: CuteEditor v5 .Net and ajax

    Bruce,
     
    The following example will help:
     
     
    You can find the source code of the above example in the download package.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  05-30-2006, 2:36 PM 19617 in reply to 12354

    Re: CuteEditor v5 .Net and ajax

    Add the oncommand attribute to the CE:Editor control declaration.  In this case oncommand="HandleEditorCommand(this)"
     
    function HandleEditorCommand( editor)
    {
       if(event.command=='PostBack' && event.commandValue=='Save')
       {
          GetEditorHTML(editor);
          event.returnValue = false;
       }
    }
     
    function GetEditorHTML(editor)
    {
       //var editor = document.getElementById('CE_Editor1_ID');
       var doc = editor.GetDocument();
       alert(doc.body.innerHTML);
    }
     
    function SetEditorHTML()
    {
       var editor = document.getElementById('CE_Editor1_ID');
       var doc = editor.GetDocument();
       doc.body.innerHTML = "some html string";
    }
View as RSS news feed in XML