I know this has been posted with even replies from Mods
http://www.telerik.com/community/forums/aspnet-ajax/editor/radeditor-lost-focus-after-autosave.aspx
But I dont have my Telerik Control inside the Update panel but it still refresh the conrol and loses its focus. Is there a way to do a AutoSave without refreshing directly from ClientSide?
| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Control_RichEdit.ascx.cs" Inherits="Common_Control_RichEdit" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <telerik:RadEditor ID="RadEditor1" runat="server" ToolsFile="../TelerikRichEditControl/ToolsFile.xml" Skin="Web20" EditModes="Design" > |
| </telerik:RadEditor> |
| <asp:Timer ID="Timer1" runat="server" Interval="500000" OnTick="Timer1_Tick"> |
| </asp:Timer> |
| <br /> |
| <br /> |
| <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> |
| <Triggers> |
| <asp:AsyncPostBackTrigger ControlID="Timer1" /> |
| </Triggers> |
| </asp:UpdatePanel> |
| <script type="text/javascript"> |
| function OnClientLoad(sender, args) |
| { |
| var timer = $find("<%=Timer1.ClientID %>"); |
| startCounter(); |
| //Attach to the spellCheckLoaded event as the spell itself is loaded with AJAX |
| sender.add_spellCheckLoaded(function() |
| { |
| var spell = sender.get_ajaxSpellCheck(); |
| spell.add_spellCheckStart(function(sender, args) |
| { |
| timer._stopTimer(); |
| //Stop counter |
| stopCounter(); |
| }); |
| spell.add_spellCheckEnd(function(sender, args) |
| { |
| //Restart the timer; |
| timer._startTimer(); |
| //Restart counter |
| startCounter(); |
| }); |
| } |
| ); |
| } |
| var strText = document.getElementById('RadEditor1'); |
| alert(strText); |
| //======================================== UI update for the remaining seconds =======================================// |
| var initialSeconds = 15; |
| var currentSeconds = initialSeconds; |
| var interval = null; |
| function startCounter() |
| { |
| if (!interval) |
| { |
| currentSeconds = initialSeconds; |
| interval = window.setInterval(function() |
| { |
| if (currentSeconds > 0) |
| { |
| currentSeconds--; |
| } |
| else |
| { |
| currentSeconds = initialSeconds; |
| } |
| var span = document.getElementById("remainingSeconds"); |
| span.innerHTML = currentSeconds; |
| }, 1000); |
| } |
| } |
| function stopCounter() |
| { |
| if (interval) window.clearInterval(interval); |
| interval = null; |
| } |
| //===============================================================================================================// |
| </script> |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Web; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| public partial class Common_Control_RichEdit : System.Web.UI.UserControl |
| { |
| public string Text |
| { |
| get { return RadEditor1.Text; } |
| set { RadEditor1.Text = value; } |
| } |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| } |
| protected void Timer1_Tick(object sender, EventArgs e) |
| { |
| //lbl1.Text = RadEditor1.Content; |
| this.RadEditor1.Focus(); |
| } |
| } |
Could you please explain me about the ClientSide Save? without refreshing the control ( Like Gmail, Yahoo Mail does?)
Thanks
Roomi
