15 Answers, 1 is accepted
The problem is more likely related to overriding the editor content in your Page_Load method. Please note that if you read the content of the editor in an event handler (such as a button event handler) this event handler executes later in the page lifecycle compared to Page_Load. This is why, in case you set the initial content in Page_Load it is mandatory to add a check, e.g.
if (!Page.IsPostBack)
{
RadEditor1.Content = "Some content";
}
In case you are having any difficulty, our suggestion is to implement your scenario using a simple <asp:TextBox> instead of RadEditor. Once you get the textbox to work as needed, all you need to do is change the textbox to RadEditor - and all should be fine.
In case you are able to implement your scenario with a simple <asp:TextBox>, yet you are facing trouble with the RadEditor, please send us your working project in a support ticket and we will make the change for you.
You should also see the following live demo on the subject: Save In Database.
Greetings,
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.
Do you experience this problem in Firefox only? If this is the case, please, see the following KB article which provides a solution: RadEditor Content Not Saved After Ajax Update in Firefox.
In order to fix the problem you will have to set the "submit" button's property UseSubmitBehavior="false", e.g.
<asp:Button ID="Save"
UseSubmitBehavior="false"
OnClick="Save_Click" runat="server" Text="Save Content" />
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.
Tom Ray
BI Solution Builders.
Please, see the following live demos which demonstrates how to save the RadEditor's content in a Database and in External HTML file:
Save In Database,
Save in External File
and
Datagrid Edit Template.
On the other hand, your problem is more likely related to overriding the editor content yourself, in your Page_Load method. Please note that if you read the content of the editor in an event handler (such as a button event handler) this event handler executes later in the page lifecycle compared to Page_Load. This is why, in case you set the initial content in Page_Load it is mandatory to add a check, e.g.
if (!Page.IsPostBack)
{
radEditor1.Html = "Some content";
}
In case you are having any difficulty, our suggestion is to implement your scenario using a simple <asp:TextBox> instead of RadEditor. Once you get the textbox to work as needed, all you need to do is change the textbox to RadEditor - and all should be fine.
In case you are able to implement your scenario with a simple <asp:TextBox>, yet you are facing trouble with the RadEditor, please send us your working project in a support ticket and we will make the change for you.
Best wishes,
Rumen
the Telerik team
I was having the exact same problem in IE9 - a rad editor control resetting it's content when it was in an update panel, I have a if (!IsPostBack) check when setting the rad editor content and the content is not being reset. Moving the editor out of the update panel fixes the reset but means the ajax button doesn't work anyway more.
I can confirm that the suggestion of adding the UseSubmitBehavior="false" tag to the ajax button resolves the issue for me.
I can't apply the fix using
UseSubmitBehavior="false"
because I'm using a RadToolbar and RadToolbarButtons (Save).
Is there a solution for my setup?
I am using the latest version Q2 2012 of the ASP.NET Ajax Controls.
You should execute OnClientButtonClicking="javascript:__doPostBack(this.id,'');return false;" in the onclientclick event of the toolbar buttons as explained in the following KB article: RadEditor Content Not Saved After Ajax Update in Firefox, Google Chrome and Safari.
Greetings,
Rumen
the Telerik team
Hi
Rad Editor Content Not Saved After Ajax Update in Firefox, Google Chrome and Safari, its working in IE.
Can any one help to to resolve this issue.
Thanks
Could you please explain your scenario in more details and the problem that you experience so that we can help you?
Best regards,
Rumen
the Telerik team
I also have problem to submit my changes on the DB. I dont inicialize on
Page_Load nothing.
This is my code example:
c# code
Email current = context.GetEmail(ID);
current.Name = RadComboBoxEmail.Text;
current.Template = RadEditorEmail.Content;
context.UpdateEmailTemplate(current);
aspx
<telerik:RadAjaxPanel runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
<telerik:RadCodeBlock runat="server">
<telerik:RadComboBox ID="RadComboBoxEmail" runat="server" DataTextField="Name" DataValueField="Id" AppendDataBoundItems="True" AutoPostBack="true" OnSelectedIndexChanged="RadComboBoxEmail_SelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem Value="0" Text="Select" />
</Items>
</telerik:RadComboBox>
</telerik:RadCodeBlock>
<br />
<br />
<telerik:RadEditor runat="server" ID="RadEditorEmail" Width="100%">
</telerik:RadEditor>
<p></p>
<telerik:RadCodeBlock runat="server">
<asp:Button ID="ButtonSave" UseSubmitBehavior="false" runat="server" Text="Submit" OnClick="ButtonSave_Click" />
</telerik:RadCodeBlock>
</telerik:RadAjaxPanel>
Does the problem happen if you exclude the editor and the submit button from the <telerik:RadAjaxPanel runat="server" LoadingPanelID="RadAjaxLoadingPanel1"> panel?
If you are unable to fix it, is it possible to isolate it in a simple working project which shows the problem and send it for examination via a support ticket?
Kind regards,
Rumen
the Telerik team
I have Use Rad Editor in X Html.If i edit or design in Rad Editor Control,i will Save the Content of Rad Editor to Data Base,in Var Binary(MAX).and How Can i Retrieve The Same Design from Database to Rad Editor?Like if i Click Edit.Please Help Me.
The Save To Database live example, demonstrates how you can load and save the content to database.
I suggest following the description and the example code provided to build the desired logic.
Regards,
Ianko
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.