How to get color code of body which set in Page Property dialog

Last post 11-08-2011, 7:37 AM by WilliamK. 5 replies.
Sort Posts: Previous Next
  •  06-27-2007, 2:52 AM 31120

    How to get color code of body which set in Page Property dialog

    hi guys..
     
    I m using this editor in my asp.net application..
     
    I want to save the color code of the body which is set from page property dialog....
     
    but i don;t know from where i can access that color code..
     
     
    please help if any one knows.
     
    Thanks in Aadvanced
    Parthiv
  •  06-27-2007, 9:54 AM 31128 in reply to 31120

    Re: How to get color code of body which set in Page Property dialog

    Parthiv,
    1. First you need to set EditCompleteDocument property to true to keep the body color.
     
     
    2.
     
    This example shows you how to get the editor Document Object.
     
     

        // get the cute editor instance
        var editor1 = document.getElementById('<%=Editor1.ClientID%>');
        
        //Get the editor content 
        var editdoc=editor1.GetDocument();
     
    After you get the document object, you can easily extract the color code of the document's body.
     
     

    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

  •  06-28-2007, 6:19 AM 31154 in reply to 31128

    Re: How to get color code of body which set in Page Property dialog

    Hi Adam,

    Thanks for replying...and things are work exactly what i want...

    Now i have another problem...

    Actually I have used cute editor in Datalist...now for modifying content i have "Edit" and "Delete" two link in every Row...now this all things are works nice in IE but in mozilla it works just once and second time nothing will be done on page...by the way i have put all things in Update Panel (ajax 1.0) ....

    I have found below error in error console of mozilla..

    Error: editor.GetScriptProperty is not a function
    Source File: http://localhost/Test/CuteSoft_Client/CuteEditor/Load.ashx?type=scripts&file=Gecko_Loader
    Line: 5

    Please help mi solve this problem..everything is fine with IE but only Mozilla make problem ......i have used Asp.net 2.0 , Ajax 1.0, Mozilla 2.0...

    thanks in advance..

  •  11-08-2011, 3:56 AM 71216 in reply to 31120

    Re: How to get color code of body which set in Page Property dialog

    This question is old but not yet answered.
     
    I have a form saving the contents of the editor to database, but where do I find the page properties created like background color, etc. I see metion of something written to the response buffer, but when I added...
     
    content = editor.GetString()
    Response.Write content 
     
    I get an error about... 

    Invalid Path

    C:\INETPUB\... include_CuteEditor.asp, line 1342

    The Path parameter for the MapPath method must be a virtual path. A physical path was used.

     
    What is the best method for retrieving the page properties?
     
     
  •  11-08-2011, 7:09 AM 71218 in reply to 71216

    Re: How to get color code of body which set in Page Property dialog

    Hi WilliamK,
     
    I think you are using the classic asp version, please try the example below. It shows you how to get the border property of the editor body.
     
    <!-- #include file = "cuteeditor_files/include_CuteEditor.asp" -->
    <html>    
        <head>
            <title>ASP Editor Demo</title>
        
        </head>
        <body>
        <form name="theForm" method="post">
         <%   
           Dim editor   
           Set editor = New CuteEditor   
           editor.ID = "Editor1"  
           editor.Text = "Hello World"  
           editor.EditCompleteDocument=true
           editor.Draw()   
        %>
           <br />     <input type="button" value="Get border property of editor content" onclick="getBorder()" />
                            
        </form>
        </body>
    </html>
    <script>
    function CuteEditor_OnInitialized(editor)
    {
        var editor1 = document.getElementById('CE_Editor1_ID');
        var editdoc = editor1.GetDocument();
        //set border when editor load
        editdoc.body.style.border="solid 1px red";
    }
    function getBorder()
    {
       var editor1 = document.getElementById('CE_Editor1_ID');
       var editdoc = editor1.GetDocument();
       //get border
       alert(editdoc.body.style.border);
    }
    </script>
     
    Regards,
     
    Ken
  •  11-08-2011, 7:37 AM 71223 in reply to 71218

    Re: How to get color code of body which set in Page Property dialog

    Aha! I just did a quick test and can see that the page color was added to the html. Will look at this more closely tomorrow.
     
    Thanks!
View as RSS news feed in XML