views:

193

answers:

1

Hi,

I was just playing around with ckeditor and can't get the darn thing to work for me. I somehow need to "data bind" the text box just before or at the same time of post back. How do I do that?

Loading the data is fine but when I click update I need to somehow retrieve the new value of the text box. It's not as easy as to call the client from the server to just get whatever is in there right? I need the client to push the changes back?

In dynamic data there is a method for binding the value of the control back to the entity in the following method:

protected override void ExtractValues(IOrderedDictionary dictionary)
{
    dictionary[Column.Name] = 
        ConvertEditedValue(HttpUtility.HtmlEncode(CKEditor.Text));
}

Now that value is always the same it's the value I originally bound to my CKEditor control:

protected override void OnDataBinding(EventArgs e)
{
    base.OnDataBinding(e);
    if (FieldValue != null)
    {
        CKEditor.Text = HttpUtility.HtmlDecode(FieldValueEditString);
    }
}

How do I solve this? :)

A: 

After postback check the Request.Form object in quick watch window and see if you can get the data of the editor over there. I can guarantee that the editor data could be found in the Request.Form object. Then you can take it out and use it !

Bootcamp
DOH! Of course, I was just trying to get the client id from CKEditor.ClientID but it's not the same as in the source of the application. Cheers!
mhenrixon