Hi, has anybody come across an issue with the RadEditor causing an entire Ajax update panel to fail on an async postback?
This only happens if the RadEditor has been generated dynamically, if I have it on a user control, it' snot a problem. Unfortunately the large legacy code base I'm working with generates a rad editor in a server control.
And has only started happening since Safari V14, it works fine on other browsers.
This can be created using a very simple form.
I'm currently using VB in visual studio 2019 , targeting framework 4.7
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div>
<asp:Label ID="Label2" runat="server" Text="Outside The Panel"></asp:Label>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
<asp:Label ID="Label1" runat="server" Text="Inside the Panel"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button2"/>
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" Text="Sync"/>
<asp:Button ID="Button2" runat="server" Text="ASync"/>
</div>
</form>
with a very simple code behind
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim radEditor = New Telerik.Web.UI.RadEditor
radEditor.ID = "Editor2"
RadEditor.Enabled = True
PlaceHolder1.Controls.Add(RadEditor)
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Text = "Updated Label 1 (sync)"
Label2.Text = "Updated label 2 (sync)"
End Sub
Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Label1.Text = "Updated Label 1 (async)"
Label2.Text = "Updated label 2 (async)"
End Sub
I've found a work around which is pretty bizarre, I can't explain why it fixes it.
But adding the following at the start of the page load function so it's the first thing that gets instantiated stops the issue from occurring. It's like the RadButton being on the page is instantiating something that the radeditor doesn't
Dim radButton = New Telerik.Web.UI.RadButton
radButton.ID = "buttonIdthing"
PlaceHolder1.Controls.Add(radButton)
Obviously that's not ideal as a fix. Another temp fix is for me to add the button control to a control containing my server control and then hiding the div it's encased in. Again this is far from ideal, as I don't know what's going on under the hood, and it's going to be a hard sell in a code review. Especially as this is only for certain versions of Safari
<telerik:RadButton ID="RadButton1" runat="server" Text="RadButton"></telerik:RadButton>
</div>
I'd be interested to know if there's going to be a permanent fix to this or if there's a better 'hack' out there.
Hi Matthew,
Can you please set UseSubmitBehavior="false" to the asp:Button and test again?
The problem is discussed in the following KB article on the matter: RadEditor Content Not Saved After Ajax Update in IE9, Firefox, Google Chrome and Safari.
Regards,
Rumen
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.