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

[Solved] RadControl 5.5.2.0

2 Answers 69 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Deepak Agrawal
Top achievements
Rank 1
Deepak Agrawal asked on 28 Jul 2009, 12:06 PM
Hi There,

I am using RadControl 5.5.2.0 with asp.net 2.0

I have placed the control on a page and I want to get contents of control to textarea on client side.
Here is my code, but it is not bringing any changes made by user to the content.

<%@ Register TagPrefix="rade" Namespace="Telerik.WebControls" Assembly="RadEditor" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Admin_Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <script>
    function Radeditor1_ClientSubmit(sender, args)
    {
        var editor = sender;
        //var theSelectionObject = editor.getSelection();
        document.getElementById('txt').value=document.getElementById('<%=Radeditor1.ClientID %>').innerHTML//editor.innerHTML;
        return false;
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
<rade:radeditor id="Radeditor1"  ShowSubmitCancelButtons=true Editable=true OnClientSubmit="Radeditor1_ClientSubmit"  runat="server" ConfigFile="~/RadControls/Editor/ConfigFile.xml"></rade:radeditor>
<textarea id=txt runat=server />
    </form>
</body>
</html>

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 28 Jul 2009, 12:33 PM
Hi Deepak,

You should use the editor's GetHtml(true) method to obtain the RadEditor's content. You can see how to get a reference to RadEditor's client object here.

Sincerely yours,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Deepak Agrawal
Top achievements
Rank 1
answered on 28 Jul 2009, 01:06 PM
Thank you very much.
Tags
Editor
Asked by
Deepak Agrawal
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Deepak Agrawal
Top achievements
Rank 1
Share this question
or