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

RadEditor inside UpdatePanel

6 Answers 157 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Renato
Top achievements
Rank 1
Renato asked on 13 Aug 2013, 11:25 AM
Hi, actually I have the code below working fine, but when I put the RadEditor inside an UpdatePanel to make it asynchronous, the code-behind dont get the RadEditor content value. Is it possible to pass the value inside an UpdatePanel, how? thanks


<telerik:RadEditor ID="reComment" runat="server" EditModes="Design" ToolbarMode="ShowOnFocus" ToolsWidth="170px" Width="412px" Height="72px">
 
                    <Tools>
                        <telerik:EditorToolGroup>
                            <telerik:EditorTool Name="Bold" />
                            <telerik:EditorTool Name="Italic" />
                            <telerik:EditorTool Name="StrikeThrough" />
                            <telerik:EditorTool Name="Underline" />
                            <telerik:EditorTool Name="InsertUnorderedList" />
                            <telerik:EditorTool Name="InsertOrderedList" />
                        </telerik:EditorToolGroup>
                    </Tools>
                </telerik:RadEditor>
                <input id="inpHide" name="inpHide" type="hidden" runat="server" />
                <span class="exp-bout-comm">
                    <asp:Button ID="btSubmit" runat="server" Text="Valider" OnClick="btSubmit_Click" /></span>


if (!IsPostBack)
{
    base.OnLoad(e);
    GetExistingComments();
 
    if (ScriptManager.GetCurrent(Page) == null)
    {
        ScriptManager sMgr = new ScriptManager();
        Page.Form.Controls.AddAt(0, sMgr);
    }
 
    btSubmit.Click += new EventHandler(btSubmit_Click);
 
    if (reComment == null)
    {
        reComment = this.FindControl("reComment") as RadEditor;
    }
 
    string content = reComment.Content;
}


6 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Aug 2013, 02:58 PM
Hello,

The reported problem is described in the following article: RadEditor Content Not Saved After Ajax Update in IE9, Firefox, Google Chrome and Safari. You can fix it using this code:

<asp:Button UseSubmitBehavior="false" ID="btSubmit" runat="server" Text="Valider" OnClick="btSubmit_Click" />

Regards,
Rumen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Renato
Top achievements
Rank 1
answered on 14 Aug 2013, 10:05 AM
Hi Rumen, I am using this code inside a User Control, when I click save it doenst get the RadEditor content but after a second click it get's the value, any reason for that? thanks

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserControl2.ascx.cs" Inherits="Expertime.PublishingComments.CONTROLTEMPLATES.UserControl2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2013.2.611.45, Culture=Neutral, PublicKeyToken=121fae78165ba3d4" %>
 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
    <asp:Panel ID="pnlRadEditor" runat="server">
        <asp:Button ID="btnSave" UseSubmitBehavior="false" runat="server" OnClick="btnSave_Click" Text="Save" />
        <telerik:RadEditor ID="RadEditor1" runat="server" EnableViewState="false"></telerik:RadEditor>
    </asp:Panel>
</telerik:RadAjaxPanel>

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
 
namespace Expertime.PublishingComments.CONTROLTEMPLATES
{
    public partial class UserControl2 : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
 
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string content1 = RadEditor1.Content;
        }
    }
}



0
Ianko
Telerik team
answered on 16 Aug 2013, 02:41 PM
Hi Renato,

I reproduced the problem using the RadEditor control in an Update panel in SharePoint 2013 and I can confirm that this is a bug and I logged it in our database for fixing.

As a token of gratitude I am updating your Telerik points.

Also you could follow this feedback portal item, where you could track the bug status, vote or comment

Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Des
Top achievements
Rank 2
answered on 19 Aug 2018, 08:18 PM
Was this ever fixed in a particular version? I have this same issue running a SharePoint 2010 web part in SharePoint 2016 (obviously runs in 2010 mode). Same code is fine in 2010 native.
0
Rumen
Telerik team
answered on 20 Aug 2018, 08:34 AM
Hello Des,

The FIX RadEditor in an UpdatePanel is not ajaxified and loses its content after a post back in IE10/IE11, the same result occurs in a custom WebPart for SharePoint 2013 scenario item has been closed due to lack of popularity - it doesn't have a single vote in it.

What you can try is to:
- get the content prior the postback/callbeck on the client editor.get_html(true) and set it with editor.set_html(editor.get_html(true)); in the OnClientSubmit event.
- not ajaxify RadEditor, i.e. exclude it from RadAjaxPanel, RadAjaxManager or the UpdatePanel.
- vote for the bug report in the feedback portal. The more users request it, the bigger the chance to get fixed is.

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Des
Top achievements
Rank 2
answered on 20 Aug 2018, 09:17 AM
Thanks Rumen.  I have updated the portal and I didn't know about the new PostBackControls tag in RadAjaxPanel which I'm hoping will fix the problem.
Tags
Sharepoint Integration
Asked by
Renato
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Renato
Top achievements
Rank 1
Ianko
Telerik team
Des
Top achievements
Rank 2
Share this question
or