The javascript error is “CKEDITOR is undefined” indicating the script is not loaded (but only when calling from subdirectoy)
Here is the folder structure I want to use:
Controls/usercontrol.ascx (this control loads ckcontrol.ascx)
Controls/ckcontrol.ascx
subdirectory/PageLoadingUserControl.aspx (this loads usercontrol.ascx)
Here is the code to register script. It is in ckcontrol.ascx This works if I move PageLoadingUserControl.aspx up to root level, but not in a subdirectory. Doesn’t make sense to me. What am I missing?
Protected Overrides Sub OnInit(e As EventArgs) 'see if ckeditor has already been included in the client script If Not Page.ClientScript.IsClientScriptIncludeRegistered("ckeditor.js") Then Page.ClientScript.RegisterClientScriptInclude("ckeditor.js", "~/packages/ckeditor_4.4.0_full/CKEditor/ckeditor.js") End If MyBase.OnInit(e) Dim sScript As String = "CKEDITOR.replace( '" & TextBox1.ClientID & "' );" ToolkitScriptManager.RegisterStartupScript(Me, Me.GetType(), "CKeditorAdd", sScript, True) End Sub