This is a migrated thread and some comments may be shown as answers.

[Solved] RadEditor Track Changes and Postbacks

1 Answer 141 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ben Slater
Top achievements
Rank 1
Ben Slater asked on 29 Nov 2009, 11:18 PM
Hi,

I'm trying to find a way to utilise the ".set_html" javascript call to obviously set the content of the editor on a postback (or client-side). I'm using a RadGrid which is holding versions of content with a selecting button which fires a 'SelectedIndexChanged' event - this is where I am attempting to set the html of the editor by calling the following:

 

 

Page.ClientScript.RegisterClientScriptBlock(Me.GetType"setversion""javascript:setContent('" + txtDescription.UniqueID + "','" + RadEditor1.UniqueID + "');"True

The function is here:

<script type="text/javascript" language="javascript">  
    function setContent(textbox,editor)  
    {  
        $find(editor).set_html($get(textbox).value);  
    }  
</script> 

Is this possible to do? If I'm heading in the wrong direction any advice would be greatly appreciated.

Thanks

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Dec 2009, 03:11 PM
Hi Ben,

Your code looks ok except that you should use ClientID instead of UniqueID with the $find method.

You should not experience problems to set the content in the SelectedIndexChanged event, but you can also try in the PreRender event too.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Ben Slater
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or