zoukankan      html  css  js  c++  java
  • ASP.NET使用FCKEditor_2.6.6与FCKeditor.Net_2.6.3配置(转载)

    首先下载FCKEditor插件

    下载网址:http://www.fckeditor.com/

    这路需要下载2种文件

    1.下载FCKeditor_2.6.6,fckeditor应用程序相关文件。

    2.下载FCKeditor.Net_2.6.3,asp.net程序需要的dll文件。

    然后创建一个web项目,将下载压缩文件解压。将fckeditor文件,夹拷贝到项目,删除多余的文件,只保留 editor文件夹,fckconfig.js,fckeditor.js,fckstyles.xml,fcktemplate.xml文件。

    创建一个新的文件夹取名叫userfiles用于存储本地上传到服务器的文件,也是fckeditor浏览服务器文件的位置(文件夹位置和名称根据个人喜好决定)。

    接下来进行fckeditor项目配置

    1.引入FredCK.FCKeditorV2.dll文件,该文件位于Fckeditor.net_2.6.3/bin/release/2.0/下。

    2.在工具栏引用fckeditor控件,工具栏中右键-选择项-.net framework组件-浏览-选择刚才引用的FredCK.FCKeditorV2.dll文件(最好引用项目下FredCK.FCKeditorV2.dll文件)。

    3.将控件拖到页面产生如下代码:

     <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath="~/fckeditor/" Width="800px" Height="300px"></FCKeditorV2:FCKeditor>

    注意:BasePath属性不是自动生成,需要自己手动添加fckeditor应用程序文件夹路径,该路径可以配置在web.config中,文件夹所在项目位置不同,路径配置也不同根据实际情况而定,

    如果路径配置不正确页面将无法显示编辑器。

    4.配置userfiles用于存储本地上传到服务器的文件,即fckeditor浏览服务器文件夹的位置代码如下:

      <appSettings>
        <add  key="FCKeditor:UserFilesPath" value="/fckeditor/userfiles/"/>
      </appSettings>

    5.配置fckconfig.js中 FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;用设置fckeditor编辑器的皮肤

    6.配置fckconfig.js中 FCKConfig.DefaultLanguage 将默认值 en 改为 zh-cn。

    代码如下:FCKConfig.DefaultLanguage  = 'zh-cn' ; 

    7.配置fckconfig.js中var _FileBrowserLanguage 和 var _QuickUploadLanguage 将默认值 php 改为 aspx

    代码如下:var _FileBrowserLanguage = 'aspx' ;var _QuickUploadLanguage = 'aspx' ;

    8.配置fckeditor/filemanager/connectors/asp/config.ascx文件,

    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 false;

      return true;
     }

    该方法用于验证用户是否具有上传文件的权限,默认return false,这里我们将false改为true。

    9.配置config.ascx文件中的SetConfig方法中: UserFilesPath = "/fckeditor/userfiles/";该方法也是设置上传的文件夹路径,最好与web.config中设置相同。

    10.如果使用时候出现,例如具有现在危险Request.Form的值,已从客户端侦测。

    请加入页面page标签中加入 ValidateRuqest=false;

     代码如下:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FCKEditor._Default" ValidateRequest="false" %>

    11.如果更多细节问题,请阅读转载的原文:http://blog.csdn.net/cuoguo1111/archive/2007/07/11/1685424.aspx

  • 相关阅读:
    java并发包——Semaphore(信号量)
    cnblogs
    linux下安装python3及对应的pip环境
    Swing实现AES加密&解密工具升级
    Netty——知识点总结
    RPC——看这一篇就…显然不够
    ORM——Mybatis
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException问题解决
    设计模式分类及常用设计模式
    Java 语言特性【四】——其他
  • 原文地址:https://www.cnblogs.com/michaelShao/p/1684533.html
Copyright © 2011-2022 走看看