I have the sample asp.net code working on my server but now I want to integrate CKFinder with an FCKEditor control which is in a detailsView. My declrative code is
Now, presumably I need to hook CKFinder into this FCKeditor at some point in the lifecycle of thepage, so I have tried this:
It doesn't error but it doesn't work either. Has anyone else done this sucessfully?
Huw
<asp:detailsview id="detailsView" DefaultMode="edit" autogenerateEditButton="true" dataKeyNames="ArticleID" dataSourceID="SqlDataSource2" runat="server" autoGenerateRows="False" > <fields> ... <asp:templateField headerText="Summary:" > <itemTemplate> <%# eval("Summary") %> </itemTemplate> <EditItemTemplate> <FCKeditorV2:FCKeditor ToolbarSet="Ice" height="200px" width="97%" id="summary" BasePath="~/FCKeditor/" runat="server" value='<%# bind("Summary")%>' /> </EditItemTemplate> </asp:templateField> ... </asp:detailsview>
Now, presumably I need to hook CKFinder into this FCKeditor at some point in the lifecycle of thepage, so I have tried this:
sub DetailsView_OnModeChanging(sender as object, e as DetailsViewModeEventArgs) Handles DetailsView.ModeChanging dim FileBrowser as CKFinder.FileBrowser = new CKFinder.FileBrowser() FileBrowser.BasePath = "/ckfinder/" FileBrowser.SetupFCKeditor(detailsview.FindControl("summary").id) end sub
It doesn't error but it doesn't work either. Has anyone else done this sucessfully?
Huw
Re: [ASP.NET] integrating with FCKEditor in a detailsView
It sounds strange that you are not having any runtime error. SetupFCKeditor throws an ApplicationException with the message "SetupFCKeditor expects an FCKeditor instance object." if an unexpected parameter is passed. So, please be sure that DetailsView_OnModeChanging is being executed properly.
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: [ASP.NET] integrating with FCKEditor in a detailsView
I'm having a similar issue.
Here's my code.
Sub DetailsView_OnModeChanging(ByVal sender As Object, ByVal e As DetailsViewModeEventArgs) Handles tradeshowDetails.ModeChanging
Dim FileBrowser As CKFinder.FileBrowser = New CKFinder.FileBrowser()
FileBrowser.BasePath = "../../ckfinder/"
FileBrowser.SetupFCKeditor(tradeshowDetails.FindControl("logo"))
End Sub
....
<asp:DetailsView ID="tradeshowDetails" runat="server" AutoGenerateRows="False" DataKeyNames="tradeshowID"
DataSourceID="tradeshowDetailDataSource" Height="50px" Width="100%" BorderWidth="0px" CellPadding="5" OnModeChanging="DetailsView_OnModeChanging">
<Fields>
....
<asp:TemplateField HeaderText="Tradeshow Logo" SortExpression="tradeshow_logo">
<EditItemTemplate>
<FCKeditorV2:FCKeditor id="logo" BasePath="~/FCKeditor/" toolbarset='image' Value='<%# Bind("tradeshow_logo") %>' runat="server" />
</EditItemTemplate>
<InsertItemTemplate>
<FCKeditorV2:FCKeditor id="logo" BasePath="~/FCKeditor/" toolbarset='image' Value='<%# Bind("tradeshow_logo") %>' runat="server" />
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="itemlogo" runat="server" Text='<%# Bind("tradeshow_logo") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
...
</Fields>
<FieldHeaderStyle VerticalAlign="Top" Width="100px" />
</asp:DetailsView>
I get the "SetupFCKeditor expects an FCKeditor instance object." error. Any idea what I'm doing wrong? It doesn't seem to recognize that there is an editor instance inside of the detailsview. I really don't have any idea what I should be doing differently. Any help would be greatly appreciated
Re: [ASP.NET] integrating with FCKEditor in a detailsView