RadEditor inside UpdatePanel

7 posts, 0 answers
  1. Renato
    Renato avatar
    16 posts
    Member since:
    Jun 2013

    Posted 13 Aug 2013 Link to this post

    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;
    }


  2. Rumen
    Admin
    Rumen avatar
    14392 posts

    Posted 13 Aug 2013 Link to this post

    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.
  3. Renato
    Renato avatar
    16 posts
    Member since:
    Jun 2013

    Posted 14 Aug 2013 Link to this post

    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;
            }
        }
    }



  4. Ianko
    Admin
    Ianko avatar
    1942 posts

    Posted 16 Aug 2013 Link to this post

    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.
  5. Des
    Des avatar
    14 posts
    Member since:
    Jan 2009

    Posted 19 Aug 2018 in reply to Ianko Link to this post

    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.
  6. Rumen
    Admin
    Rumen avatar
    14392 posts

    Posted 20 Aug 2018 Link to this post

    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.
  7. Des
    Des avatar
    14 posts
    Member since:
    Jan 2009

    Posted 20 Aug 2018 in reply to Rumen Link to this post

    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.
Back to Top