CKEditor 3.0.1 The method of configuration under ASP.net

Source: Internet
Author: User


CKEditor 3.0.1 The method to configure under ASP.net:
Official Website: ckeditor (fully functional, open source editor, with source code included)
Download Address: CKEditor 3.0.1 (released on October 2009)

1, download Ckeditor_3.0.1.zip and extract to CKEditor (under the root directory).

2. Load ckeditor.js in aspx page or master template page
<!--load CKEditor JS file-->
<script src= ". /ckeditor/ckeditor.js "type=" Text/javascript "></script>
use CKEditor in <body> tags:
<!--use ckeditor must define class= "CKEditor"-->
<asp:textbox id= "txtcontent" class= "CKEditor" textmode= "MultiLine" text= "<%# Bind (" info ")%> ' runat= '" Server " ></asp:TextBox>
using the same methods as other. NET controls, setting text= ' <%# Bind (' info ')%> ' facilitates interaction with the data source.

3, the config.js custom
/*
Copyright (c) 2003-2009, Cksource-frederico Knabben. All rights reserved.
For licensing, license.html or http://ckeditor.com/license
*/
ckeditor.editorconfig = function (config) {
Define changes to the default configuration here. For example:
Config.language = ' ZH-CN '; Configure language
Config.uicolor = ' #FFF '; Background color
Config.width = 400; Width
Config.height = 400; Height
Config.skin = ' v2 '; Editor Style
Cancel the drag to resize feature
config.resize_enabled = false;
   //Basic Toolbars 
   //Config.toolbar = "basic"; 
   //Universal Toolbars 
   //Config.toolbar = "full"; 
   /Custom toolbars 
    Config.toolbar = 
    [ 
    [' Source ', '-', ' Preview '], [' Cut ', ' Copy ', ' Paste ', ' pastetext ', ' Pastefromword '], [' Undo ', '] Redo ', '-', ' find ', ' Replace ', '-', ' selectall ', ' Removeformat '], [' numberedlist ', ' bulletedlist ', '-', ' outdent ', ' Inden T ', ' Blockquote ', ' showblocks '], '/', 
    [' Bold ', ' italic ', ' underline ', ' Strike ', '-', ' subscript ', ' Superscript '], [' Justifyleft ', ' justifycenter ', ' justifyright ', ' Justifyblock '], [' Link ', ' Unlink ', ' Anchor '], [' Image ', ' Flash ', ' Table ', ' horizontalrule ', ' Specialchar ', '/', 
    [' Styles ', ' Format ', ' Font ', ' FontSize '], [' TextColor ', ' bgcolor '], [' Maximize ', '-', ' about '] 
   ];
};

4, to streamline CKEditor can be _samples, _source folder deleted, Lang directory can only retain en.js, Zh.js, zh-cn.js three language files.

5, CKEditor does not have the upload function, need to integrate ckfinder to realize upload function.
Ckfinder 1.4.1.1 The configuration method for integration with CKEditor 3.0.1:
Official Website: Ckfinder (powerful and easy to use Ajax File Manager for Web browsers)
Download Address: ckfinder 1.4.1.1 for asp.net (Updated 02.10.2009)

6, download Ckfinder_aspnet_1.4.1.1.zip and extract to Ckfinder (under the root directory).

7, open "/ckfinder/config.ascx", modify baseurl for baseurl = "~/ckfinder/userfiles/";
Note "~"
Userfiles as the default path, the directory will automatically generate images, flash and other subdirectories.

8, in the Ckeditor/config.js integrated Ckfinder.
Custom CKEditor Style
Ckeditor.editorconfig = function (config) {
......
}
Integrate Ckfinder in CKEditor, and note that Ckfinder's path selection is correct.
Ckfinder.setupckeditor (null, '.. /ckfinder/');

9. Load ckfinder.js in aspx page or master template page
<!--load Ckfinder JS file-->
<script src= ". /ckfinder/ckfinder.js "type=" Text/javascript "></script>
use Ckfinder in <body> tags:
<!--use ckeditor must define class= "CKEditor"-->
<asp:textbox id= "txtcontent" class= "CKEditor" textmode= "MultiLine" text= "<%# Bind (" info ")%> ' runat= '" Server " ></asp:TextBox>
using the same methods as other. NET controls, setting text= ' <%# Bind (' info ')%> ' facilitates interaction with the data source.


10, can be _samples, _source folder deleted, Lang directory can only retain en.js, Zh.js, zh-cn.js three language files.
Common Error elimination methods:
Symptom (s) : file is not browsable for security reasons. Contact your system administrator and check the Ckfinder configuration file.
Statement:
public override bool Checkauthentication ()
{
Reture false;
}

Reason: User authentication is not set or the user is not logged in.


Symptom: Unknown error

Statement:
public override bool Checkauthentication ()
{
Reture true;
}


Reason: The settings are not user authenticated, but the BaseURL path is incorrect.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.