无法让 FCKEditor 在虚拟目录中工作
我有一个 WebForm,其中包含 FCKeditor 的以下定义:
<FCKeditorV2:FCKeditor ID="txtBody" runat="server"
BasePath="/fckeditor/"
Height="480px"
ToolbarSet="WebCal1"
>
</FCKeditorV2:FCKeditor>
这在我的基于 VS2008 的 Web 应用程序中运行良好。但是,当我将其部署到 IIS 中的虚拟目录时,它会在 /fckeditor
文件夹中查找 FCKEditor 文件(例如 javascript、样式表等...),而不是在 / MyVirtualDir/fkceditor
。
我尝试将 BasePath 更改为 ~/fckeditor/
,但它无法在我的开发计算机上运行。
正确的方法是什么,以便 FCKEditor 映射到正确的目录。在我的项目中,fckeditor
目录就位于根目录之外。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在虚拟目录、根目录和本地计算机上使用“~/fckeditor/”都没有问题。
你认为还会发生其他事情吗? Firebug 说发生了什么?
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?
我想通了。让 FCKEditor 感到困惑的是 SkinPath。当我将 BasePath 设置为“~/fckeditor/”时,它会将此字符串+皮肤的路径传递给 JavaScript(例如~fckeditor/editor/skins/office2003)。并且javascript无法解析相对路径。
所以解决方案是将这段代码放在表单Page_Load事件中:
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: