Hi, I decided to upgrade to v2.6.3 today after discovering that it had a fix in it for the asp.net update panel. However it did not work, after abit of debugging i discovered it was because i am using the Ajax Control Toolkit which has it's own version of the ScriptManager (derived from the inbuilt ScriptManager). Therefore i suggest the following fix to the fckeditor .net control to make this work.
1. First you need to add a reference to System.Web.Extensions (depending on which version of the framework you are targetting).
2. Open the FCKeditor.cs file and change the following
to
Hope this helps.
1. First you need to add a reference to System.Web.Extensions (depending on which version of the framework you are targetting).
2. Open the FCKeditor.cs file and change the following
object oScriptManager = null; // Search for the ScriptManager control in the page. Control oParent = this.Parent; while ( oParent != null ) { foreach ( object control in oParent.Controls ) { // Match by type name. if ( control.GetType().FullName == "System.Web.UI.ScriptManager" ) { oScriptManager = control; break; } } if ( oScriptManager != null ) break; oParent = oParent.Parent; } // If the ScriptManager control is available. if ( oScriptManager != null ) { try { // Use reflection to check the SupportsPartialRendering // property value. bool bSupportsPartialRendering = ((bool)(oScriptManager.GetType().GetProperty( "SupportsPartialRendering" ).GetValue( oScriptManager, null ))); if ( bSupportsPartialRendering ) { string sScript = "(function()\n{\n" + "\tvar editor = FCKeditorAPI.GetInstance('" + this.ClientID + "');\n" + "\tif (editor)\n" + "\t\teditor.UpdateLinkedField();\n" + "})();\n"; // Call the RegisterOnSubmitStatement method through // reflection. oScriptManager.GetType().GetMethod( "RegisterOnSubmitStatement", new Type[] { typeof( Control ), typeof( Type ), typeof( String ), typeof( String ) } ).Invoke( oScriptManager, new object[] { this, this.GetType(), "FCKeditorAjaxOnSubmit_" + this.ClientID, sScript } ); // Tell the editor that we are handling the submit. this.Config[ "PreventSubmitHandler" ] = "true"; } } catch { } }
to
System.Web.UI.ScriptManager oScriptManager = System.Web.UI.ScriptManager.GetCurrent(this.Page); // If the ScriptManager control is available. if ( oScriptManager != null ) { try { if (oScriptManager.SupportsPartialRendering) { string sScript = "(function()\n{\n" + "\tvar editor = FCKeditorAPI.GetInstance('" + this.ClientID + "');\n" + "\tif (editor)\n" + "\t\teditor.UpdateLinkedField();\n" + "})();\n"; this.Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), "FCKeditorAjaxOnSubmit_" + this.ClientID, sScript); // Tell the editor that we are handling the submit. this.Config[ "PreventSubmitHandler" ] = "true"; } } catch { } }
Hope this helps.
Re: ASP.NET UpdatePanel Fix for v2.6.3
We have avoided making references to System.Web.UI.ScriptManager in the code, to make it compatible with ASP.Net installation that have no references to the ASP.Net Ajax controls. All that has been covered and discussed at the following ticket:
http://dev.fckeditor.net/ticket/234
The ticket has been reopened because of the issue you have described. We'll be working to find a definitive solution for it.
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn