This article has moved to my new blog at the URL:
Friday, 23 May 2008
Wednesday, 07 May 2008
FCKeditor - HTTP Error 404 - Not Found.
While working on the content management for my website, I wanted to use a WYSIWYG editor to edit parts of my home page. I have used FCKeditor before and find it one of the most complete editors out there at the moment, besides it's been around for years now...
They have a .NET control wrapper for it so you can just drag it onto your web forms from the control toolbox. This seemed like the perfect solution until actually trying to run the application for the first time. I followed all the instructions on the support section on their website and everything should have worked.
For some or other reason this fails with a HTTP 404 error? After much searching on the support pages I couldn't find a solution to this issue. I did dig up a vague answer on a forum but it boils down to this:
The default location of the FCKeditor control can't be found if your site is running in a virtual directory. The solution to this, thankfully is quite simple. You need to add the location of the control files to BasePath property of the control.
EG: If you have the FCKeditor directory in the root of your site you would use "BasePath='~/FCKeditor/'"
NB: You must provide a trailing forward slash otherwise you get a "The resource cannot be found." error!
So to close off, your code needs to look like this with the path of the editor control directory as the string for BasePath.
They have a .NET control wrapper for it so you can just drag it onto your web forms from the control toolbox. This seemed like the perfect solution until actually trying to run the application for the first time. I followed all the instructions on the support section on their website and everything should have worked.
- Add the main control code (FCKeditor directory) to the root of the site.
- Add the .NET wrapper assembly to the bin directory or add it as a reference to your project.
- Add the control to the control toolbox and drag it on, done, or so it seems.
For some or other reason this fails with a HTTP 404 error? After much searching on the support pages I couldn't find a solution to this issue. I did dig up a vague answer on a forum but it boils down to this:
The default location of the FCKeditor control can't be found if your site is running in a virtual directory. The solution to this, thankfully is quite simple. You need to add the location of the control files to BasePath property of the control.
EG: If you have the FCKeditor directory in the root of your site you would use "BasePath='~/FCKeditor/'"
NB: You must provide a trailing forward slash otherwise you get a "The resource cannot be found." error!
So to close off, your code needs to look like this with the path of the editor control directory as the string for BasePath.
Labels:
ASP.NET
Subscribe to:
Posts (Atom)