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

Content and Text properties not updated on postback

3 Answers 122 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sugar
Top achievements
Rank 1
Sugar asked on 26 Jan 2010, 05:15 PM
Banging my head here!

For testing purposes I load the content of a RadTextBox and a RadEditor with some sample text on load. Then, on postback I can get the data from the RadTextbox just fine, but, the data from the RadEditor is exactly the same from what was loaded! It's like nothing is being posted back for me to get the values from. Has anyone seen this before?

        <tr> 
            <td class="Label">Body</td> 
            <td><telerik:RadTextBox ID="txtBody" Height="200" Width="500px" runat="server" Skin="Office2007" CssClass="InputBox" TextMode="MultiLine" /></td
        </tr>         
             
        <tr> 
            <td class="Label">Body</td> 
            <td> 
            <telerik:RadEditor ID="RadEdit01" runat="server" Width="500px" Height="300"  Skin="Office2007" AutoResizeHeight="true"
            <Tools> 
                <telerik:EditorToolGroup> 
                    <telerik:EditorTool Name="Bold" /> 
                    <telerik:EditorTool Name="Italic" /> 
                    <telerik:EditorTool Name="Underline" /> 
                    <telerik:EditorTool Name="Cut" /> 
                    <telerik:EditorTool Name="Copy" /> 
                    <telerik:EditorTool Name="Paste" /> 
                    <telerik:EditorTool Name="FontName" /> 
                    <telerik:EditorTool Name="RealFontSize" /> 
                </telerik:EditorToolGroup> 
                <telerik:EditorToolGroup> 
                    <telerik:EditorTool Name="InsertTable" /> 
                    <telerik:EditorTool Name="InsertImage" /> 
                    <telerik:EditorTool Name="LinkManager" /> 
                    <telerik:EditorTool Name="Unlink" /> 
                    <telerik:EditorTool Name="InsertOrderedList" /> 
                    <telerik:EditorTool Name="InsertUnorderedList" /> 
                </telerik:EditorToolGroup> 
            </Tools> 
            </telerik:RadEditor> 
            </td> 
        </tr> 


In my page on postback I can do txtBody.text and see my new changed values, but, RadEdit01.Content nothing has changed, even though I typed in different text.

Nothing fancy is going on, but I am working within master pages. Not sure why that would cause any issues. Nothing is inside a content area for Ajax calls. I can't figure this one out!

3 Answers, 1 is accepted

Sort by
0
Sugar
Top achievements
Rank 1
answered on 26 Jan 2010, 05:22 PM
To expand a little, I ran an analyzer on the post and I'm seeing that my text is not being submitted on the post. Wondering why this would be the case?

Parameter Name    Value ctl00_FormContentPlaceHolder_txtBody_text    Body Testing
Parameter Name    Value ctl00$FormContentPlaceHolder$RadEdit01    Testing

(The above RadEdit01 should be RadEdit Testing) as that is what I typed in the editor window.











0
Sugar
Top achievements
Rank 1
answered on 26 Jan 2010, 05:54 PM
And, finally, to make this more interesting, when I do a

__doPostBack('__Page', action);

then everything works fine. But, for all the posts we do document.forms[0].submit(); .. and, in this case I don't get the data on the post-back.

Why would the submit() not get the data back to me from the RadEdit ?
0
Rumen
Telerik team
answered on 29 Jan 2010, 09:55 AM
Hi Sugar,

You should also fire the editor.saveContent(); method before submitting the content, e.g

editor.saveContent();
document.forms[0].submit();

This will ensure that the editor content is saved before its submission.

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
Sugar
Top achievements
Rank 1
Answers by
Sugar
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or