LogoASPAlliance: Articles, reviews, and samples for .NET Developers
Solution to Theme Conflict with FCKEditor
by shahriar Iqbal Chowdhury
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 15205/ 30


According to me, FCKeditor is the coolest HTML editor. 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 files or images through the editor, it displays an wired XML parse error stating that "Using themed CSS files requires a header control on the page."


What happen basically because of page theme or site theme, FCKeditor's default theme is not loaded and the editor throws parse error as because FCKeditor try to load the style attributes beside web forms theme. I have dug through the configuration files inside FCKeditor and do some R&D over different forum posts and found that it's a common error while integrating with ASP.NET 2.0 web forms  that use themes. After going through different forums and digging the source codes, I got the solution. Basically we need to make some configuration changes to be compatible with page themes at  "~/fckeditor/filemanager/connectors/aspx/config.ascx" file under our webservers FCKeditor folder where all configuration files resides.

Figure 1

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.

Figure 2

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:


<pages styleSheetTheme="" theme=""> </pages>

For these lines the default style of FCKeditor will be loaded. It will disable the page theme inside FCKeditor's configuration folder and no page-specific or site-specific theme will be available. Hope this will help developers and prevent them from wasting their time just to find out this silly solution.

Product Spotlight
Product Spotlight 

©Copyright 1998-2022  |  Page Processed at 2022-10-01 11:23:41 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search