Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Solution to ASP.NET Theme Conflict with FCKEditor

0.00/5 (No votes)
2 Dec 2009 1  
Solution to ASP.NET theme conflict with FCKEditor

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.

snpashot2.GIF

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

snpashot.GIF

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

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here