这两天接触了FCKeditor控件,遇到了fckeditor 编辑器无法显示的问题。一个asp.net企业站FCKeditor编辑器出现了“Internet Explorer 无法显示该网页”,“Internet Explorer 不能链接到您请求的网页。此页可能暂时不可用”,“已取消到该网页的导航”等错误(根据游览器不同,显示的错误页不同,总之是FCKeditor编辑器无法正常显示)。同时fckeditor本地运行正常,但是到了服务器上运行fckeditor 出问题,打开FCKeditor编辑器属性中出现res://ieframe.dll/dnserror.htm#或者res://ieframe.dll/dnserrordiagoff.htm#错误。以及fckeditor编辑器能够正常打开而静态页面不能打开等症状时,网上都说是设置路径的问题,其实不然,应该是IIS配置伪静态时设置不当引起的。以下是引自sytWeibo的专栏的“FCKeditor 2.6.4在ASP.NET中的配置方法”文章中有解决方案,原文地址为http://blog.csdn.net/sytWeibo/archive/2009/07/12/4341641.aspx。如果如我所说的问题,可以直接参考六、常见问题。
1.根目录下除editor目录、fckconfig.js、fckeditor.js、 fckstyles.xml、 fcktemplates.xml这几个保留,其余的全部删除
2.editor\filemanager\connectors目录中除aspx目录外全部删除
3.editor\lang目录中除en.js、zh.js 、zh-cn.js外全部删除
4.删除_samples目录,当然如果你想看示例,就不要删除这个目录了。
FCKConfig.ToolbarSets["Default"] = [
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'] // No comma for the last row.
] ;
//上面一段我去掉了一些不常用的功能,可以根据实际需要增加。
FCKConfig.DefaultLanguage = 'zh-cn' ; //原来是en
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py 改成aspx
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
2.在Bin中加入DLL文件
编辑FCKeditor\editor\filemanager\connectors\aspx\config.aspx 中修改
private bool CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
//
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.
return true; //原来这里是 false;不过还是建议看看上面的警告}
可执行文件:c:"windows"microsoft.net"framework"v2.0.50727"aspnet_isapi.dll
扩展名:.html
动作:限制为 GET,HEAD,POST,DEBUG
脚本引擎:选中
确认文件是否存在:不选
可执行文件:c:"windows"microsoft.net"framework"v2.0.50727"aspnet_isapi.dll
确认文件是否存在:不选
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as
//
// return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.
}
请求的 URL: /fckEditor/editor/fckeditor.aspx” 解决方法如下:
相关新闻
- 小程序登录流程图理解 2020-08-18
- 在C#中获取web.config中的配置信息 2021-08-23
- 小程序open-data头像样式 2021-04-10
- 小程序rich-text 富文本解析图片过大和图片路径的问题 2020-11-25
- C#中去掉字符串的最后一个字符 2020-11-23