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

[Solved] radeditor

1 Answer 101 Views
Editor
This is a migrated thread and some comments may be shown as answers.
preeti
Top achievements
Rank 1
preeti asked on 22 Apr 2008, 02:13 PM
Hi,
     While using radeditor I got the error. I used gethtml and sethtml method for copy and paste text from word into .net application.But when i tried to use it , It shows me error. If you don't mind then can u plz send me the code for copy paste text with using javascript function with using radeditor.

Thanks,

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Apr 2008, 02:35 PM
Hello preeti,

Here is a basic example which you can use and enhance:

<asp:ScriptManager ID="ScriptManager1" runat="server" />

<telerik:radeditor runat="server" ID="RadEditor1">
   <Content>
       Here is sample content!
   </Content>
</telerik:radeditor>
<input type="button" value="set content" onclick="SetContent('sample content');return false;" />
<input type="button" value="reset content" onclick="SetContent('');return false;" />
<input type="button" value="paste content" onclick="PasteContent();return false;" />
<input type="button" value="get selected content" onclick="GetContent();return false;" />
<script type="text/javascript">
function SetContent(content)
{
   var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor client object
   editor.set_html(content);
}
function PasteContent()
{
   var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor client object
   editor.pasteHtml("paste content"); //paste some content
}
function GetContent()
{
   var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor client object
   alert(editor.get_html(""));
}
</script>

Please, also review the following help article: Getting a Reference to RadEditor.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
preeti
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or