Hi Jakub, thanks for your reply. I checked the links you recommended.
In my case:
Ajax seems to be working as expected, the update panel updates on async postback. No custom scripts are being registered. CKEditor in update panel, visible-false on pageload (not rendered). Set to visible on async postback. Script downloads but scriptload error occurs.
Adding an instance of CKEditor on pageload solves the error, script files are downloaded on pageload and don't need registered on asyc postback.
CKEditor rendered on asyn postback would seem to be a fairly common scenario, in a formview or a multipanel. However I don't see a lot of posts about it so I presume others are not having a problem, maybe it is my setup.
It's not a big problem, I'll register a hidden editor instance on pageload
The solution proposed by @gavinoheaghra to add the control on page_load works fine in most cases. If you have the editor in a div with visible="false" though and switch the visibility it still breaks.
A quick fix to the problem I posted just above is to put another instance of the CKEditor on the page within a div with disply:none. That fixes the issue, I guess the javascript is registered at page load and both controls use the same javascript?
@jdiolatzis I don't see CKEditor control tags in your code.
Are you using plain JavaScript CKEditor? If that is the case then yes, you might be having problems with update panel. When using .NET you should be using CKEditor control for .NET. That is why it was created in the first place.
@ j.swiderski No, using the .NET version. As per @gavinoheaghra suggestions we added the control on page load (that's why there is a place holder), although you don't really need to if you have two instances of the CKEditor on the page.
Thank you for clarifying that. I have seen your post but just needed to be sure.
I will post this question to our .NET developers once more. Like I have written before they were not able to reproduce the problem but perhaps with new information they will be able to say more.
@jdiolatzis could you tell me if you are getting the same problem as @gavinoheaghra i.e. the script doesn't load? Could you perhaps what error you were getting (message and part of stack trace) when this workaround was not used ?
Thanks, Gavin, for the hint about including a hidden CKEditor instance somewhere on the page that loads on initial page-load. I was stumped to figure out a work-around, until I read your post. For others, here is an example with a hidden CKEditor that allows the View2 CKEditor to load properly. Without the first CKEditor, the error noted in this thread, will occur. The Example is based on a modification of the FirstUse.aspx file found in the samples:
Re: CKEditor Script fails to load in Update Panel/Formview
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re: CKEditor Script fails to load in Update Panel/Formview
Html rendered on async postback
Firebug error
http://localhost:64383/ScriptResource.a ... ffbb6d64f2
Fiddler Traffic
http://localhost:64383/admin/wysiwyg.aspx
http://localhost:64383/admin/wysiwyg.aspx
http://localhost:64383/ckeditor/ckeditor.js?t=B8DJ5M3
Re: CKEditor Script fails to load in Update Panel/Formview
http://msdn.microsoft.com/en-us/library/bb397451.aspx
http://forums.asp.net/p/1170450/1958413.aspx
http://blogs.visoftinc.com/2007/09/23/a ... -problems/
Re: CKEditor Script fails to load in Update Panel/Formview
In my case:
Ajax seems to be working as expected, the update panel updates on async postback.
No custom scripts are being registered.
CKEditor in update panel, visible-false on pageload (not rendered).
Set to visible on async postback.
Script downloads but scriptload error occurs.
Adding an instance of CKEditor on pageload solves the error, script files are downloaded on pageload and don't need registered on asyc postback.
CKEditor rendered on asyn postback would seem to be a fairly common scenario, in a formview or a multipanel.
However I don't see a lot of posts about it so I presume others are not having a problem, maybe it is my setup.
It's not a big problem, I'll register a hidden editor instance on pageload
Regards Gavin
Re: CKEditor Script fails to load in Update Panel/Formview
Re: CKEditor Script fails to load in Update Panel/Formview
without any overheadhttp://ckeditor.com/download
Re: CKEditor Script fails to load in Update Panel/Formview
If you have the editor in a div with visible="false" though and switch the visibility it still breaks.
Here is an example:
If on the button click you set visible="True" of the divEDitor you still get error message.
Any chance for a quick fix?
Thanks
Re: CKEditor Script fails to load in Update Panel/Formview
That fixes the issue, I guess the javascript is registered at page load and both controls use the same javascript?
Re: CKEditor Script fails to load in Update Panel/Formview
Are you using plain JavaScript CKEditor? If that is the case then yes, you might be having problems with update panel.
When using .NET you should be using CKEditor control for .NET. That is why it was created in the first place.
Re: CKEditor Script fails to load in Update Panel/Formview
As per @gavinoheaghra suggestions we added the control on page load (that's why there is a place holder), although you don't really need to if you have two instances of the CKEditor on the page.
Re: CKEditor Script fails to load in Update Panel/Formview
I will post this question to our .NET developers once more. Like I have written before they were not able to reproduce the problem but perhaps with new information they will be able to say more.
@jdiolatzis could you tell me if you are getting the same problem as @gavinoheaghra i.e. the script doesn't load? Could you perhaps what error you were getting (message and part of stack trace) when this workaround was not used ?
any resolution?
Hello all,
I am having a similar issue. I am getting a script load error in the edittemplate of the gridview control. It however works in emptydatatemplate.
My post is here: http://ckeditor.com/forums/CKEditor/CKeditor-script-fails-to-load
Any help would be highly appreciated.
Thanks
Good news right answer!!!
You are very lucky!
Because I find a way to resolve this error
<CKEditor:CKEditorControl ID="CKEditorControl1" runat="server" Height="150" BasePath="~/Editor/ckeditor/" Skin="v2"> </CKEditor:CKEditorControl>.................. </asp:UpdatePanel> <div style="display: none"> <CKEditor:CKEditorControl ID="CKEditorControl1" runat="server" Height="150" BasePath="~/Editor/ckeditor/" Skin="v2"> </CKEditor:CKEditorControl> </div>You see?
<div style="display:none">
We must define an other edit out of the UpdatePanel.
And we can't do like this:
<CKEditor:CKEditorControl ID="CKEditorControl1" runat="server" Height="150" BasePath="~/Editor/ckeditor/" Skin="v2" Visable="false"> </CKEditor:CKEditorControl>If you do this. Sorry the error still have.
I'm Chinese and my English is very poor. If you can't understand what I say you can send mail to me:gwf_25sz@163.com
Good news right answer!!!
You are very lucky!
Because I find a way to resolve this error
<CKEditor:CKEditorControl ID="CKEditorControl1" runat="server" Height="150" BasePath="~/Editor/ckeditor/" Skin="v2"> </CKEditor:CKEditorControl>.................. </asp:UpdatePanel> <div style="display: none"> <CKEditor:CKEditorControl ID="CKEditorControl1" runat="server" Height="150" BasePath="~/Editor/ckeditor/" Skin="v2"> </CKEditor:CKEditorControl> </div>You see?
<div style="display:none">
We must define an other edit out of the UpdatePanel.
And we can't do like this:
<CKEditor:CKEditorControl ID="CKEditorControl1" runat="server" Height="150" BasePath="~/Editor/ckeditor/" Skin="v2" Visable="false"> </CKEditor:CKEditorControl>If you do this. Sorry the error still have.
I'm Chinese and my English is very poor. If you can't understand what I say you can send mail to me:gwf_25sz@163.com
Hidden CKEditor Instance Work-Around
Thanks, Gavin, for the hint about including a hidden CKEditor instance somewhere on the page that loads on initial page-load. I was stumped to figure out a work-around, until I read your post. For others, here is an example with a hidden CKEditor that allows the View2 CKEditor to load properly. Without the first CKEditor, the error noted in this thread, will occur. The Example is based on a modification of the FirstUse.aspx file found in the samples:
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI.WebControls" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
MultiView1.SetActiveView(View1);
}
}
protected void btnToView2_Click(object sender, EventArgs e)
{
MultiView1.SetActiveView(View2);
}
protected void btnToView1_Click(object sender, EventArgs e)
{
MultiView1.SetActiveView(View1);
}
</script>
<!--
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>First Use — CKEditor for ASP.NET Sample</title>
<link href="sample.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<h1 class="samples">
CKEditor for ASP.NET Sample — Adding the CKEditor for ASP.NET Control to a Page
</h1>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:UpdatePanel ID="AchievementUpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="display: none;">
<CKEditor:CKEditorControl ID="CKEditorInitializer" runat="server" Height="200" BasePath="~/ckeditor">
Exists solely to initialize CKEditor script recources for yet-to-be-shown view.
</CKEditor:CKEditorControl>
</div>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server" >
<h2>View One</h2>
<asp:Button ID="btnToView2" runat="server" Text="Switch"
onclick="btnToView2_Click" />
</asp:View>
<asp:View ID="View2" runat="server">
<h2>View Two</h2>
<asp:Button ID="btnToView1" runat="server" Text="Switch" onclick="btnToView1_Click" />
<CKEditor:CKEditorControl ID="CKEditor1" runat="server" Height="200" BasePath="~/ckeditor">
Editor displayed in View2
</CKEditor:CKEditorControl>
</asp:View>
</asp:MultiView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="footer">
<hr />
<p>
CKEditor — The text editor for the Internet — <a class="samples" href="http://ckeditor.com/">
http://ckeditor.com</a>
</p>
<p id="copy">
Copyright © 2003–2011, <a class="samples" href="http://cksource.com/">CKSource</a>
— Frederico Knabben. All rights reserved.
</p>
</div>
</form>
</body>
</html>