Solution to ASP.net Theme Conflict with FCKEditor
 
Published: 20 Jan 2010
Unedited - Community Contributed
Abstract
Solution to Asp.net theme conflict with FCKEditor
by shahriar Iqbal Chowdhury
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 15791/ 37
Article Contents:

Introduction

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."

Solution

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 asp.net 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 asp.net 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:

 

<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<pages styleSheetTheme="" theme=""> </pages>
</system.web>
</configuration>

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.



User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-02-26 1:27:45 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search