Hello:
I use vs. 2008 with .Net 2.0. I have a page with this code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:WebPartZone ID="wpzCenterZone" runat="server" HeaderText="Center Zone" Width="100%">
<ZoneTemplate>
</ZoneTemplate>
</asp:WebPartZone>
</ContentTemplate>
</asp:UpdatePanel>
I have a webpart that's is a blog and show FCKEditor when I need edit the blog like this:
Controls.Clear();
...
fckText = new FCKeditor();
fckText.ID = "BlogItemEditor";
fckText.BasePath = "~/fckeditor/";
fckText.ToolbarSet = "Owned";
[1]
...
then I add a button, but when check for FCKEditr's value don't change, I check the forumn soluction and add this change next line [1]
[1]
Page.ClientScript.RegisterOnSubmitStatement(fckText.GetType(), "editor",
"FCKUpdateLinkedField('" + fckText.ClientID + "');");
Then I create a javascript with this code and include in the page
<script src="FCKHack.js" type="text/javascript"></script>
[FCKHack.js]
function FCKUpdateLinkedField(id)
{
try
{
if(typeof(FCKeditorAPI) == "object")
{
FCKeditorAPI.GetInstance(id).UpdateLinkedField();
}
}
catch(err)
{
}
}
But nothing happend, and the values neve have the value, If I eliminate the updatepanel all work fine. Please if you have some help, describe what steps I have to make to fix this problem.
Best regards,
Owen.
I use vs. 2008 with .Net 2.0. I have a page with this code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:WebPartZone ID="wpzCenterZone" runat="server" HeaderText="Center Zone" Width="100%">
<ZoneTemplate>
</ZoneTemplate>
</asp:WebPartZone>
</ContentTemplate>
</asp:UpdatePanel>
I have a webpart that's is a blog and show FCKEditor when I need edit the blog like this:
Controls.Clear();
...
fckText = new FCKeditor();
fckText.ID = "BlogItemEditor";
fckText.BasePath = "~/fckeditor/";
fckText.ToolbarSet = "Owned";
[1]
...
then I add a button, but when check for FCKEditr's value don't change, I check the forumn soluction and add this change next line [1]
[1]
Page.ClientScript.RegisterOnSubmitStatement(fckText.GetType(), "editor",
"FCKUpdateLinkedField('" + fckText.ClientID + "');");
Then I create a javascript with this code and include in the page
<script src="FCKHack.js" type="text/javascript"></script>
[FCKHack.js]
function FCKUpdateLinkedField(id)
{
try
{
if(typeof(FCKeditorAPI) == "object")
{
FCKeditorAPI.GetInstance(id).UpdateLinkedField();
}
}
catch(err)
{
}
}
But nothing happend, and the values neve have the value, If I eliminate the updatepanel all work fine. Please if you have some help, describe what steps I have to make to fix this problem.
Best regards,
Owen.

Re: FCKEditor in WebPart inside UpdateControl
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: FCKEditor in WebPart inside UpdateControl
I'm also experiencing this Problem. Any news on the Bugfix?
Paul.
Re: FCKEditor in WebPart inside UpdateControl
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: FCKEditor in WebPart inside UpdateControl
Cheers,
Paul.
Re: FCKEditor in WebPart inside UpdateControl
I've traced it down to the following. Maybe you Javascript guru's can shed some light on this.
I've added the following script to the Main Page's <Head> Section.
<script type="text/javascript" language="javascript"> // Some Class function AjaxUpdateClass() { alert("Init"); this.UpdateEditorFormValue = function() { for ( i = 0; i < parent.frames.length; ++i ) if ( parent.frames[i].FCK ) { alert("Found an Editor"); parent.frames[i].FCK.UpdateLinkedField(); } } } // instantiate the class var MyAjaxUpdateObject = new AjaxUpdateClass(); </script>Added an 'onSubmit' to the <Form ...> like this
I added an alert to the 'UpdateLinkedField' function
UpdateLinkedField : function() { alert("UpdateLinkedField"); var value = FCK.GetXHTML( FCKConfig.FormatOutput ) ; if ( FCKConfig.HtmlEncodeOutput ) value = FCKTools.HTMLEncode( value ) ; FCK.LinkedField.value = value ; FCK.Events.FireEvent( 'OnAfterLinkedFieldUpdate' ) ; },I do see the Alert 'Init' and on Submit I also see the alert 'Found an Editor' but I never see the Alert 'UpdateLinkedField'.
Any ideas?
Cheers,
Paul.
Re: FCKEditor in WebPart inside UpdateControl
http://forums.asp.net/p/1028530/2409081.aspx#2409081
public class FCKeditor : System.Web.UI.Control, IPostBackDataHandler { public FCKeditor() { PreRender += new EventHandler(FCKeditor_PreRender); } void FCKeditor_PreRender(object sender, EventArgs e) { ScriptManager current = ScriptManager.GetCurrent(this.Page); String script = @"function FCKUpdateLinkedField(id) { try { if(typeof(FCKeditorAPI) == 'object') { FCKeditorAPI.GetInstance(id).UpdateLinkedField(); } } catch(err) { } }"; if (current != null) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "FCKUpdater", script, true); ScriptManager.RegisterOnSubmitStatement(this, this.GetType(), "WebContentManagerEditorScript_" + this.ClientID, "FCKUpdateLinkedField('" + this.ClientID + "');"); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "FCKUpdater", script, true); this.Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), "WebContentManagerEditorScript_" + this.ClientID, "FCKUpdateLinkedField('" + this.ClientID + "');"); } } private const string cstrTransLessThen = "&ls;"; private const string cstrTransGreaterThen = ">"; private string StringToHTML(string pstrString) { return pstrString.Replace(cstrTransGreaterThen, ">").Replace(cstrTransLessThen, "<"); } private string HTMLToString(string pstrHTML) { return pstrHTML.Replace(">", cstrTransGreaterThen).Replace("<", cstrTransLessThen); } public string Text { get { return HTMLToString(Value); } set { Value = StringToHTML(value); } }Re: FCKEditor in WebPart inside UpdateControl
Some pointers however. Before you can use this class you need to add it to a Library Project.
The Project needs a 'strong name' signing:
A file with your specified name is now added to the Project (i.e. MyLibrary.snk).
Now compile the Project, add a reference to your library in the Web Project, and Presto when you go and edit a Web Page in the Toolbox the 'MyFCKEditor' Control is visible. Simply drag-n-drop the Control onto your page and you're read to rock-n-roll.
In my projects I still need to add the BasePath='fckeditor/' because the default specified in the .Net FCKeditor Project (= '/fckeditor/') does not work for me. You can bind the Text (and Value) properties like this:
<MyLibrary:MyFCKEditor ID="MyFCKEditor" runat="server" BasePath="fckeditor/" Text='<%# Bind("Text") %>' />Cheers,
Paul.
using System; using System.Collections.Generic; using System.Text; using System.Web.UI; using System.Web.UI.WebControls; using FredCK.FCKeditorV2; using System.ComponentModel; using System.Text.RegularExpressions; using System.Globalization; using System.Security.Permissions; namespace MyLibrary.Common { [ DefaultProperty("Value"), ValidationProperty("Value"), ToolboxData("<{0}:MyFCKeditor ID=\"MyFCKEditor\" runat=\"server\"></{0}:MyFCKeditor>"), Designer("FredCK.FCKeditorV2.FCKeditorDesigner"), ParseChildren(false) ] public class MyFCKEditor : FCKeditor { public MyFCKEditor() { PreRender += new EventHandler(MyFCKEditor_PreRender); } void MyFCKEditor_PreRender(object sender, EventArgs e) { ScriptManager current = ScriptManager.GetCurrent(this.Page); String script = @"function FCKUpdateLinkedField(id) { try { if(typeof(FCKeditorAPI) == 'object') { FCKeditorAPI.GetInstance(id).UpdateLinkedField(); } } catch(err) { } }"; if (current != null) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "FCKUpdater", script, true); ScriptManager.RegisterOnSubmitStatement(this, this.GetType(), "WebContentManagerEditorScript_" + this.ClientID, "FCKUpdateLinkedField('" + this.ClientID + "');"); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "FCKUpdater", script, true); this.Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), "WebContentManagerEditorScript_" + this.ClientID, "FCKUpdateLinkedField('" + this.ClientID + "');"); } } private const string cstrTransLessThen = "#LS#"; private const string cstrTransGreaterThen = "#GT#"; private string StringToHTML(string pstrString) { return pstrString.Replace(cstrTransGreaterThen, ">").Replace(cstrTransLessThen, "<"); } private string HTMLToString(string pstrHTML) { return pstrHTML.Replace(">", cstrTransGreaterThen).Replace("<", cstrTransLessThen); } [DefaultValue("")] public string Text { get { return HTMLToString(Value); } set { Value = StringToHTML(value); } } [DefaultValue("")] public new string Value { get { return base.Value; } set { base.Value = value; } } } }Re: FCKEditor in WebPart inside UpdateControl
Re: FCKEditor in WebPart inside UpdateControl
http://dev.fckeditor.net/ticket/234
I have already attached a fix
any