FCKeditor 2.6.3 在ASP.NET中使用时出现的问题及解决方案
2009-09-09 22:03
399 查看
1、设置FCKeditor的BasePath和UserFilesPath
BasePath是FCKeditor的根目录,而UserFilesPath则是上传的图片、文件等等的存储目录。在FCKeditor文件夹下(我的FCKeditor位于网站的根目录下),添加Web.Config文件,在<appSettings>配置节下添加如下代码:
<add key="FCKeditor:BasePath" value="/FCKeditor/" />
<add key="FCKeditor:UserFilesPath" value="~/UploadFiles/" />
在开发过程中,UserFilesPath可以使用 "~/UploadFiles/" 的形式,发布后,你可能会遇到两种情况:1)以虚拟目录的形式来运行的,如果是以虚拟目录的形式来运行你的项目,那么UserFilesPath的值就不需要改变。2)以独立网站的形式来运行,如果你的网站以独立网站的形式来运行的话,则必须要将 "~/UploadFiles/" 改为 "/UploadFiles/” 。否则就会报错!
2、设置FCKeditor上传组件所使用的语言
在FCKeditor文件夹下有个fckconfig.js文件,该文件是FCKeditor的配置文件,找到如下代码:
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py 如上面的代码所示,将_FileBrowserLanguage和_QuickUploadLanguage的值设为ASPX。同时,将FCKeditor编辑器的默认语言设为'zh-cn',其代码如下:
FCKConfig.DefaultLanguage = 'zh-cn' ;
3、设置FCKeditor的工具栏
打开fckconfig.js文件,在该文件中我们可以找到如下代码:
Code
TypeConfig[ "File" ].FilesPath = "%UserFilesPath%file/";
TypeConfig[ "File" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
TypeConfig[ "File" ].QuickUploadPath = "%UserFilesPath%file/";
TypeConfig[ "File" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
TypeConfig[ "Image" ].FilesPath = "%UserFilesPath%image/";
TypeConfig[ "Image" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
TypeConfig[ "Image" ].QuickUploadPath = "%UserFilesPath%image/";
TypeConfig[ "Image" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%media";
TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
修改完成以后,再使用该功能时,就会自动上传到相应的目录中去了!
BasePath是FCKeditor的根目录,而UserFilesPath则是上传的图片、文件等等的存储目录。在FCKeditor文件夹下(我的FCKeditor位于网站的根目录下),添加Web.Config文件,在<appSettings>配置节下添加如下代码:
<add key="FCKeditor:BasePath" value="/FCKeditor/" />
<add key="FCKeditor:UserFilesPath" value="~/UploadFiles/" />
在开发过程中,UserFilesPath可以使用 "~/UploadFiles/" 的形式,发布后,你可能会遇到两种情况:1)以虚拟目录的形式来运行的,如果是以虚拟目录的形式来运行你的项目,那么UserFilesPath的值就不需要改变。2)以独立网站的形式来运行,如果你的网站以独立网站的形式来运行的话,则必须要将 "~/UploadFiles/" 改为 "/UploadFiles/” 。否则就会报错!
2、设置FCKeditor上传组件所使用的语言
在FCKeditor文件夹下有个fckconfig.js文件,该文件是FCKeditor的配置文件,找到如下代码:
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py 如上面的代码所示,将_FileBrowserLanguage和_QuickUploadLanguage的值设为ASPX。同时,将FCKeditor编辑器的默认语言设为'zh-cn',其代码如下:
FCKConfig.DefaultLanguage = 'zh-cn' ;
3、设置FCKeditor的工具栏
打开fckconfig.js文件,在该文件中我们可以找到如下代码:
Code
TypeConfig[ "File" ].FilesPath = "%UserFilesPath%file/";
TypeConfig[ "File" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
TypeConfig[ "File" ].QuickUploadPath = "%UserFilesPath%file/";
TypeConfig[ "File" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/" );
TypeConfig[ "Image" ].FilesPath = "%UserFilesPath%image/";
TypeConfig[ "Image" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
TypeConfig[ "Image" ].QuickUploadPath = "%UserFilesPath%image/";
TypeConfig[ "Image" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/" );
TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%media";
TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
修改完成以后,再使用该功能时,就会自动上传到相应的目录中去了!
相关文章推荐
- ASP.NET中使用FCKeditor 2.6.3碰到些常见问题的解决方法
- FCKeditor在ASP.NET下出现的问题及解决方案
- 解决在asp.net中 使用 ajax UpdatePanel出现乱码问题的解决方案
- 使用JMAIL NET 组件 收取邮件 时 编码出现问题的解决方案
- 在ASP.NET AJAX Control Toolkit 1.0中使用GB2312的编码时出现乱码的两种解决方案
- 记ASP.NET 使用 X509Certificate2 出现的一系列问题
- 工作中的问题解决 -- (win2003 asp.net) Session和带页面回传的方法无法正常使用解决方案
- VS2008下使用FCKeditor2.6.3安装配置详细图解(asp.net)
- ASP.NET中使用fckeditor上传文件出现“The server didn't send back a proper XML response……”
- ASP.NET 4.0中使用FreeTextBox和FCKeditor遇到安全问题警告的解决办法
- ASP.NET 在IIS 操作Excel时出现的权限问题的解决方案
- FCKEditor 2.6.3 ASP.NET 图片上传 停留在进度条问题解决
- ASP.NET MVC 5 中使用Frameset中Session、Cookie值消失的问题完整解决方案
- ASP.NET 4.0中使用FreeTextBox和FCKeditor遇到安全问题警告的解决办法
- linux系统下基于mono部署asp.net,使用ef6与mysql出现的问题【索引】
- asp.net在使用fckeditor 2.6版的几个问题的解决
- ASP.NET使用FCKEditor_2.6.6与FCKeditor.Net_2.6.3配置(转载)
- asp.net 使用Ueditor过程中出现的问题及解决办法
- ASP.NET实现Excel导入SQL数据库以及各种出现的问题解决方案
- asp中使用FCKeditor存取数据时出现乱码问题解决方法