Introduction
According to me, FCKeditor is the finest HTML editor till today. It is very popular among web developers because of its rich set of useful features. It's also compatible with ASP.NET. But it has some issues with the ASP.NET page theme. When uploading file or image through editor, it displays wired XML parse error stating that "Using themed CSS files requires a header control on the page".
Using the Code
I went through the forums and found that it's a common error while integrating with ASP.NET pages that use themes. After going through different forums and digging the source codes, I got the solution. Basically we need to make some changes to be compatible with page themes on ~/fckeditor/filemanager/connectors/aspx/config.ascx file under our webservers fckeditor file.
As you can see above, "UserFilesPath" is specified, we need to put Page.ResolveUrl when specifying the value, i.e. we need to put something like:
UserFilesPath =Page.ResolveUrl("~/userfiles/");
[In this case, my default user files upload folder is "userfiles" under web servers root directory].
Another point is that we don't need ASP.NET themes within the fckeditor folder, so simply add a web.config file in the folder as shown in the above screenshot, with the following content:
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<pages styleSheetTheme="" theme=""> </pages>
</system.web>
</configuration>
Those lines will do the trick. It will disable the page theme and site theme if specified and under fckeditor folder, no page theme will be available. Hope this will help developers and prevent them from wasting their time just to find out this silly solution.
History
- 2nd December, 2009: Initial post