Hello everyone,
I am using FCKeditor, which is demonstrated in CMS. The control is working as intended in CMS application but when I am using the same Control in other application then it fails. I think this is because of Details view (data bound control).
Is not fckeditor supportable with data bound controls? If I am right then is there any other method to resolve it? Or if I wrong then can anybody tell me what is wrong with the code that I am using?
Code:
<asp:DetailsView ID="DetailsView1" runat="server"
AutoGenerateRows="False" CellPadding="4" DataKeyNames="Id"
DataSourceID="News" DefaultMode="Insert" >
<Fields>
<asp:TemplateField HeaderText="Subject" SortExpression="Subject">
<EditItemTemplate>
<FCKeditorV2:FCKeditor ID="txtSubject" runat="server" BasePath="../FCKeditor/" ToolbarSet="Basic" Height="50px" Value='<%# Bind("Subject") %>'>
</FCKeditorV2:FCKeditor>
</EditItemTemplate>
<InsertItemTemplate>
<FCKeditorV2:FCKeditor ID="txtSubject" runat="server" BasePath="../FCKeditor/" ToolbarSet="Basic" Height="50px" Value='<%# Bind("Subject") %>'>
</FCKeditorV2:FCKeditor>
<asp:RequiredFieldValidator ID="rfvSubject" runat="server"
ControlToValidate="txtSubject" Display="Dynamic" ErrorMessage="[Required]"
SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Subject") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Body" SortExpression="Body">
<EditItemTemplate>
<FCKeditorV2:FCKeditor ID="txtBody" runat="server" ToolbarSet="CMS" BasePath="../FCKeditor/" Height="200px" Width="600px" Value='<%# Bind("Body") %>'>
</FCKeditorV2:FCKeditor>
</EditItemTemplate>
<InsertItemTemplate>
<FCKeditorV2:FCKeditor ID="txtBody" runat="server" ToolbarSet="CMS" BasePath="../FCKeditor/" Height="200px" Width="600px" Value='<%# Bind("Body") %>'>
</FCKeditorV2:FCKeditor>
<br />
<asp:RequiredFieldValidator ID="rfvBody" runat="server"
ControlToValidate="txtBody" Display="Dynamic" ErrorMessage="[Required]"
SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Body") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CheckBoxField DataField="Active" HeaderText="Active"
SortExpression="Active" />
<asp:CommandField ShowInsertButton="True" ValidationGroup="Insert" />
</Fields>
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:DetailsView>
Please tell me what is wrong with the code. Well I am not having any instance of FCKeditor in code behind file so that I can not find this control in code behind file.
Any suggestion is most welcome.
Thank you...