欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
CKEditor與CKFinder整合
 CKEditor與CKFinder整合

首先,下載2個(gè)插件包

CKEditor下載地址:http://ckeditor.com/

CKFinder下載地址:http://ckfinder.com/

1.然后創(chuàng )建項目,將解壓的文件夾拷貝到項目中,編寫(xiě)頁(yè)面代碼如下:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CKEditor._Default" ValidateRequest="false" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head runat="server">
  5. <title></title>
  6. <!--引用腳本文件-->
  7. <script type="text/javascript" language="javascript" src="ckeditor/ckeditor.js"></script>
  8. <script type="text/javascript" language="javascript" src="ckfinder/ckfinder.js"></script>
  9. </head>
  10. <body>
  11. <form id="form1" runat="server">
  12. <div>
  13. <asp:TextBox ID="Content" runat="server" TextMode="MultiLine" Height="250px" Width="500px"></asp:TextBox>
  14. <!--這句腳本代碼必須放在文件后面-->
  15. <script type="text/javascript">
  16. CKEDITOR.replace('<%=Content.ClientID%>', {});
  17. var editor = CKEDITOR.replace('<%=Content.ClientID%>');
  18. CKFinder.SetupCKEditor(editor, '../ckfinder/');
  19. </script>
  20. <asp:Literal ID="Literal1" runat="server" ></asp:Literal>
  21. <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="ok" />
  22. </div>
  23. </form>
  24. </body>
  25. </html>


2.配置CKEditor下的config.js文件代碼如下:

  1. CKEDITOR.editorConfig = function( config )
  2. {
  3. // Define changes to default configuration here. For example:
  4. // config.language = 'fr';
  5. // config.uiColor = '#AADC6E';
  6. config.language = 'zh-cn'; //中文
  7. config.uiColor = '#54ADD8'; //編輯器顏色
  8. config.font_names = '宋體;楷體_GB2312;新宋體;黑體;隸書(shū);幼圓;微軟雅黑;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana';
  9. config.toolbar_Full =
  10. [
  11. ['Source', '-', 'Preview', '-', 'Templates'],
  12. ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Print', 'SpellChecker', 'Scayt'],
  13. ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
  14. ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
  15. '/',
  16. ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'],
  17. ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv'],
  18. ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
  19. ['Link', 'Unlink', 'Anchor'],
  20. ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'],
  21. '/',
  22. ['Styles', 'Format', 'Font', 'FontSize'],
  23. ['TextColor', 'BGColor'],
  24. ['Maximize', 'ShowBlocks', '-', 'About']
  25. ];
  26. config.toolbar_Basic =
  27. [
  28. ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', '-', 'About']
  29. ];
  30. config.width =771; //寬度
  31. config.height = 260; //高度
  32. //如果需要使用ckfinder上傳功能必須添下列代碼
  33. config.filebrowserBrowseUrl = location.hash + '/ckfinder/ckfinder.html';
  34. config.filebrowserImageBrowseUrl = location.hash + '/ckfinder/ckfinder.html?Type=Images';
  35. config.filebrowserFlashBrowseUrl = location.hash+'/ckfinder/ckfinder.html?Type=Flash';
  36. config.filebrowserUploadUrl = location.hash + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files';
  37. config.filebrowserImageUploadUrl = location.hash + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images';
  38. config.filebrowserFlashUploadUrl = location.hash + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash';
  39. };


3.配置CKFinder下的Config.ascx文件:

首先配置下載權限

  1. public override bool CheckAuthentication()
  2. {
  3. // WARNING : DO NOT simply return "true". By doing so, you are allowing
  4. // "anyone" to upload and list the files in your server. You must implement
  5. // some kind of session validation here. Even something very simple as...
  6. //
  7. // return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
  8. //
  9. // ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
  10. // user logs on your system.
  11. // return fase;
  12. return true;
  13. }


其次配置Config.ascx服務(wù)器文件路徑,用于存儲圖片的文件夾

  1. BaseUrl = " ~/ckfinder/userfiles/";


該路徑根據實(shí)際情況不同,設置也不同。

4.引用CKFinder文件中bin文件下的Release中ckfinder.dll否則會(huì )有錯誤。

至此配置已經(jīng)完成。

注意事項:

1.運行的時(shí)候,可能出現例如:System.Web.HttpRequestValidationException: 從客戶(hù)端(Content="<p>fdgdfgdfg</p>...")中檢測到有潛在危險的 Request.Form 值的錯誤,

該錯誤需要在頁(yè)面page標簽中添加validateRequest="false".

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CKEditor._Default" ValidateRequest="false" %>

2.編譯的時(shí)候如果提示我AssemblyTitle、AssemblyCompany等屬性重復,該錯誤可能是ckeditor,ckfinder示例代碼中的AssemblyInfo.cs文件存在沖突,刪除示例代碼 source文件或者samples文件中的代碼即可。
3、要精簡(jiǎn) ckeditor 可以將 _samples、_source 文件夾刪除,lang 目錄下可以只保留en.js、zh.js、zh-cn.js 三個(gè)語(yǔ)言文件。

1、常見(jiàn)錯誤排除方法:

ckfind文件夾的config.ascx中找到如下語(yǔ)句

癥狀:因為安全原因,文件不可瀏覽。請聯(lián)系系統管理員并檢查CKFinder配置文件。

語(yǔ)句:
public override bool CheckAuthentication()
{
  reture false;
}

原因:未設置用戶(hù)身份驗證或者用戶(hù)未登錄,設置為 reture true;(不進(jìn)行用戶(hù)身份驗證)即可。

癥狀:未知錯誤

語(yǔ)句:
public override bool CheckAuthentication()
{
  reture true;
}

原因:設置不進(jìn)行用戶(hù)身份驗證,但是 BaseUrl 路徑不對。

2、調試頁(yè)面,出現“A potentially dangerous Request.Form value was detected from the client",按照經(jīng)驗,在web.config中增加

<system.web>
<pages validateRequest="false" />
system.web>

還是同樣錯誤,在頁(yè)面頭部加入,

還是出錯。

vs2008 以下 在頁(yè)面直接改validateRequest="false",如果你是vs2010的話(huà) 在頁(yè)面直接改validateRequest="false",還得把 webconfig 中的 <httpRuntime requestValidationMode="4.0"/> 改為 <httpRuntime requestValidationMode="3.5"/>降低下版本

3、編譯的時(shí)候如果提示我AssemblyTitle、AssemblyCompany等屬性重復,該錯誤可能是ckeditor,ckfinder示例代碼中的AssemblyInfo.cs文件存在沖突,刪除示例代碼 source文件或者samples文件中的代碼即可。

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
CKEDITOR CKFINDER的圖片上傳配置(C#/asp.net/php)
折騰CKeditor與CKfinder的一點(diǎn)心得 - WEB前臺 - CKeditor -...
CKEditor3.0在asp.net環(huán)境下上傳文件的配置,集成CKFinder
PHP中CKEditor和CKFinder使用心得 | Lancer's Blog
CKEditor + CKFinder + JWplayer plugin 完成在線(xiàn)編輯器
在JSP里使用CKEditor和CKFinder
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久