View Full Version : About cuteeditor

Oct 26, 2009, 4:47 AM
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/"

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.


10, 26, 2009

Oct 26, 2009, 10:09 AM
You can not update non-coolite controls during an AjaxEvent/AjaxMethod.

Oct 26, 2009, 2:13 PM
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.

Oct 26, 2009, 9:32 PM
Thank you geoffrey.mcgill! I'll try with JavaScript, thank you for your help 

Oct 28, 2009, 1:27 AM
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...");

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

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


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

Oct 28, 2009, 6:41 AM

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...");

Oct 28, 2009, 9:39 PM
Thank you vladimir!

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