About cuteeditor

  1. #1

    About cuteeditor



    Hi, I have a Cuteeditor in my project like

    
    ****<CE:Editor ID="edtContent" runat="server" AutoConfigure="Simple" Width="750" Height="430"
                                                    ResizeMode="None" ThemeType="Office2007" BreakElement="Br" FilesPath="../CuteSoft_Client/CuteEditor/"
                                                    EditorWysiwygModeCss="../Css/example.css">
                                                </CE:Editor>
    and I wanna assign some value for it , and I do it like this:

    
    ****protected void OnClick(object sender, AjaxEventArgs e)
            {
    *          *****edtContent.Text="My Text Value...";
            }
    but when I click the button, it's still blank there in the Editor......:(




    wish some one can help, thank your very much!!




    PSD:I used the ExtButton, and I don't want to use aspbutton.




    huangshan

    10, 26, 2009
  2. #2

    RE: About cuteeditor




    You can not update non-coolite controls during an AjaxEvent/AjaxMethod.
  3. #3

    RE: About cuteeditor

    Hi Huangshan,

    As mentioned by @jchau, non-coolite controls can not be directly updated during an AjaxEvent, although you can send back a small piece of JavaScript which can be executed on the client to update the control.

    All you would need to know is what JavaScript is required on the client to update the CuteEditor. Then use the .AddScript Method to configure the response.

    Example (not tested, just theoretical)

    this.Button1.AddScript("{0}.setText(\"{1}\")", this.edtContent.ClientID, "My Text Value...");
    Hope this helps.

    Geoffrey McGill
    Founder
  4. #4

    RE: About cuteeditor

    Thank you geoffrey.mcgill! I'll try with JavaScript, thank you for your help*
  5. #5

    RE: About cuteeditor



    Hi! *geoffrey.mcgill,

    This can set some content *into the editor*at client side:

    <script language="JavaScript" type="text/javascript">*
    			function setHTML()
    			{
    				// get the cute editor instance
    				var editor1 = &#100;ocument.getElementById('<%=Editor1.ClientID%>');
    				// Set the editor 
    				editor1.setHTML("My text...");
    			}		
    </script>



    But I tried to do this at server side.....

    and I want put some variable into the editor, hope you can help, thanx!




    PSD:

    *
    this.Button1.AddScript("{0}.setText(\"{1}\")", this.edtContent.ClientID, "My Text Value...");
    does not work fine...:(
  6. #6

    RE: About cuteeditor

    Hi,

    If tested and ensure that setHTML works fine for CuteEditor then use setHTML instead setText


    this.Button1.AddScript("{0}.setHTML('{1}')", this.Editor1.ClientID, "My Text Value...");
  7. #7

    RE: About cuteeditor






    Thank you vladimir!

    it's *resolved! thank you for all your help!

Posting Permissions