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
It seems your problem is related to ticket #234, to be fixed for the next version.
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
@PaulSinnema, you should follow the ticket for new on that.
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.
Added an 'onSubmit' to the <Form ...> like this
I added an alert to the 'UpdateLinkedField' function
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
Hi,
In the mean time, I've got it working. Thanks to a post on the ASP.Net Forum (http://forums.asp.net/p/1028530/2409081.aspx#2409081) I was able to adjust the code of the FCKeditor.cs in such a way that no external code is needed to get it working with AJAX. I'll post it below.
I need the 'Text' Property just to be able to store HTML into the Database. My Provider does not allow me to store HTML directly, so my solution replaces the '<' and '>' to '&ls;' and '>' using the Value property.
Expanded the constructor to add an eventhandler for the PreRender event.
Thanks for the help.
Cheers,
Paul.
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:
Cheers,
Paul.
Re: FCKEditor in WebPart inside UpdateControl
Re: FCKEditor in WebPart inside UpdateControl
Paul,
FredCK has already pointed you towards ticket #234: http://dev.fckeditor.net/ticket/234. It is also related to ticket #1255.
It covers this bug in depth and I have already attached a fix, which still needs some work, since sometimes a different Javascript error appears (although the editor continues working regardless).
My fix inherits from FCKeditor as does yours, it also implements IScriptControl to provide AJAX hooks which fix the Firefox issue you now have. Unfortunately there are also issues in the Javascript core of FCKeditor itself; basically the form.submit events get thoroughly munged due to the way FCKeditor tries to hook itself in which conflicts with ASP.NET AJAX handling of submit.
Please read all my comments on tickets #234 and #1255 before you do any further work on this, since I have already researched the causes in detail, and I'm afraid much of your efforts may have been wasted - although it can't hurt to understand the problem fully yourself, if we're eventually going to arrive at a complete fix.
I haven't looked at this in quite a while, since the fix currently meets my needs - the project using it is in alpha, so as long as it's working I can ignore the errors. However I want to have this wrapped up for us to go beta in the next month or two.
Please post any further discussion as comments on tickets #234 or #1255 as appropriate, not here please! I only became aware of this thread because Frederico posted a comment on #234.
/serializer