FCKeditor 2.6在ASP.NET中的配置方法_.Net教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      推薦:asp.net如何連接sql server2000數據庫
      大家好,以下是有關ASP.net連接SQL Server2000數據庫的例程, 在這里和大家分享一下: Asp.net連接SQL Server2000數據庫例程詳解: 以下為引用的內容

      FCKEditor目前的最新版本是2.6,但支持.NET的DLL版本還是2.5,本文介紹FCKEditor2.6在ASP.NET中的配置方法。

      本文的示例下載地址(包含了整個解決方案及網站,下載后即可使用):
      地址:http://www.china-aspx.com/Forum/showtopic-57.aspx

      FCKEditor官方下載地址:http://www.fckeditor.net/download

      配置方法如下:

      一、在官方網站上下載

      下載地址:http://sourceforge.net/project/downloading.php?group_id=75348&filename=FCKeditor_2.6.zip

      解壓后目錄結構如下圖所示:



      二、刪除不必要的文件

      從官方下載下來的FCKEditor2.6大小有3.61M(解壓后),其實有很多文件對于只用ASP.NET的來講是不需要的,我們可以刪除不必要的文件:

      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目錄,當然如果你想看示例,就不要刪除這個目錄了。

      三、FCKEditor2.6的詳細設置

      1.fckconfig.js中修改

      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文件
      DLL文件下載地址:http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=137125

      3.在工具欄中加入DLL文件

      4.配置上傳路徑
      編輯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;不過還是建議看看上面的警告
      }

      在SetConfig方法中設置

      UserFilesPath = "~/Upload/FCKEditor";//我這里設置在了網站根目錄下的Upload/FCKEditor目錄中,根據實際情況和個人喜好而定。

      好了,大家有什么問題可以去http://www.china-aspx.com/Forum提問,也可MSN:china-aspx@hotmail.com

      本文的示例下載地址(包含了整個解決方案及網站,下載后即可使用):
      地址:http://www.china-aspx.com/Forum/showtopic-57.aspx

      分享:asp.net2.0學習歷程-菜鳥到中級程序員的飛躍
      如果你是一個菜鳥或者自認為初學者那么本文非常適合你。 不能說這30本書就是最佳組合,但是可以說這個組合不差;本人曾博覽群書,很多書重復,很多書講的不適用,這些書都是目前書店可以買到

      來源:模板無憂//所屬分類:.Net教程/更新時間:2008-08-22
      相關.Net教程