views:

99

answers:

2

I have a WebForm that contains the following definition for the FCKeditor:

<FCKeditorV2:FCKeditor ID="txtBody" runat="server" 
            BasePath="/fckeditor/" 
            Height="480px"
            ToolbarSet="WebCal1"                
>
</FCKeditorV2:FCKeditor>

This works fine in my VS2008-based web application. However, when I deploy it to a Virtual Directory in IIS, it looks for the FCKEditor files (e.g. javascript, stylesheets, etc...) in the /fckeditor folder, not in the /MyVirtualDir/fkceditor.

I've tried changing the BasePath to ~/fckeditor/, but then it won't work on my dev machine.

What is the right way to go, so that the FCKEditor maps onto the right directory. In my project the fckeditor directory is right off the root.

+1  A: 

I user "~/fckeditor/" without a problem on both virtual directories, root directories and local machine.

Do you think something else could be going on? What does Firebug say is happening?

Dustin Laine
+1  A: 

I figured it out. The piece that was confusing the FCKEditor was the SkinPath. When I'd set the BasePath to "~/fckeditor/", it would path this string + the path of the skin to JavaScript (e.g. ~fckeditor/editor/skins/office2003). And javascript could not resolve the relative path.

So the solution is to place this code in the form Page_Load event:

txtSignature.SkinPath = Path.Combine(this.ResolveUrl(txtSignature.BasePath), "editor/skins/office2003/");
AngryHacker