12 Answers, 1 is accepted
The case could be that the editor's original value overwrites the one submitted from the browser.
This happens, for example, if you did not put the initial value setting in a if block checking whether the page is postback.
Here is what you should do in your Page_Load method:
If Not Page.IsPostBack Then
' Set the editor content from database here
End If
If this is not the reason for the problem, we ask you to open a support ticket and send a sample project including your aspx page with its codebehind. We will review your code and provide a solution.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I thought this might be the case, but Ive already tried putting:
If not page.ispostback then
....
End If
In fact the whole Page_Load Sub Routine is now within that if statement and its still storing the original values.
Please, review the following demo example: Save in database and review the following help article: Save in database.
If you are not able to solve the issue, please open a support ticket from your Client.net account and send a sample working project that demonstrates the problem.
I will examine it and try to provide a solution.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Dear Rumen,
I also have the same problem and for me, it is an issue with including the RADEditor within an update panel and viewing the page within FireFox 2.0.0.11. If you run the following code:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="ajax1.WebForm1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:UpdatePanel runat="server" ID="updatePanelPageContent">
<ContentTemplate>
<asp:ScriptManager ID="test" runat="server"></asp:ScriptManager>
<% radcontent.Text = RadEditor1.Content()%>
<asp:Label runat="server" ID="radcontent"></asp:Label>
<telerik:RadEditor ID="RadEditor1" runat="server"></telerik:RadEditor>
<asp:Button ID="submit" Text="submit" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
you will see that the label does not update when you submit the form in FF. IE is fine. As a secondary issue, the RADEditor does not display correctly in FF.
Any help with the saving problem would be much appreciated.
Many thanks
If you want to submit form data (like the editor value) with Asp.Net buttons and MS Ajax, you need to set UseSubmitBehavior="false". For Example:
<asp:button runat="server" id="ButtonSave" text="Save" onclick="ButtonSave_Click" CssClass="button" UseSubmitBehavior="false" />
If you do not set this property, non-IE browsers will not be able to send the Ajax request properly. Here is how to modify your code:<asp:UpdatePanel runat="server" ID="updatePanelPageContent">
<ContentTemplate>
<% radcontent.Text = RadEditor1.Content;%>
<asp:Label runat="server" ID="radcontent"></asp:Label>
<telerik:RadEditor ID="RadEditor1" runat="server"></telerik:RadEditor>
<asp:Button ID="submit" UseSubmitBehavior="false" Text="submit" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thanks!
Dear Rumen,
Thanks your response. Unfortunately my application uses an asp:ImageButton instead of asp:Button and there is no UseSubmitBehavior property for an asp:ImageButton. Can you please tell me what the solution is for the same example but with the following line of code replacing the asp:Button?
| <asp:ImageButton ID="cmdPageContentSave" runat="server" AlternateText="Icon : Save" ImageUrl="~/assets/gfx/save.gif" Height="16px" /> |
Many thanks for your help.
MS AJAX takes all INPUT content and puts it together to create the POST request. However the RadEditor's content area is an editable IFRAME and the editor puts its content in hidden field to make it participate in POST request.
However in Mozilla, the editor "learns" about AJAX postback too late when all the POST fields are already processed by MS AJAX. This is the reason for the problem. The solution is to get and set the editor's content when the image button is clicked:
<asp:UpdatePanel runat="server" ID="updatePanelPageContent">
<ContentTemplate>
<% radcontent.Text = RadEditor1.Content;%>
<asp:Label runat="server" ID="radcontent"></asp:Label>
<script type="text/javascript">
function SaveEditorContent()
{
var editor = $find("<%=RadEditor1.ClientID %>");
editor.set_html(editor.get_html());
}
</script>
<telerik:RadEditor ID="RadEditor1" runat="server"></telerik:RadEditor>
<asp:ImageButton
OnClientClick="SaveEditorContent()" ID="cmdPageContentSave" runat="server" AlternateText="Icon : Save" ImageUrl="http://www.telerik.com/DEMOS/ASPNET/Editor/Img/productLogo.gif" Height="16px" />
</ContentTemplate>
</asp:UpdatePanel>
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Cheers
Unfortunately the problem lies entirely in the MS AJAX framework implementation and cannot be fixed by us for two reasons:
1. The problem is rooted deep in the browser-specific code of the MS AJAX and the sequence of events that happens when an AJAX request is initiated. As you see this only happens in FireFox/Mozilla, but not in IE
2. The editor has no reliable way of its own to detect that an AJAX request in which the editor itself participates begins. To detect such an event, we would need to copy and duplicate lots of code from the MS AJAX framework. Which, one would think, is OK if it will solve the problem. But it won't (see point 1 above) - the code of the MS AJAX framework itself gets confused in its situation.
This is why, the only workaround known at this point is the workaround provided - and that is to explicitly inform the editor when an AJAX request is about to begin.
Greetings,
Tervel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I have a form with a RadEditor on it, and a button, the codebehind for the button click event uses the editor content. All was well testing in IE, but I just noticed today that Firefox could not see the content.
This thread helped fix the problem, thanks!
Rob
I am happy to hear that the provided solution helped you to solve the problem.
I just want to inform you that we made a KB article on the topic, which can be helpful too:
RadEditor Content Not Saved After Ajax Update in Firefox.
Kind regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
