Ckeditor 3.0.1 configuration in Asp.net

Source: Internet
Author: User

How to configure ckeditor 3.0.1 in Asp.net:

Official Website: ckeditor (fully functional, open source Editor, with source code encoded)

: Ckeditor 3.0.1 (released on 16 October 2009)

1. Download ckeditor_3.0.1.zip and decompress it to ckeditor (in the root directory ).

2. Load ckeditor. js on the aspx page or master template page

<! -- Load the ckeditor JS file -->
<SCRIPT src = "../ckeditor. js" type = "text/JavaScript"> </SCRIPT>

Use ckeditor in the <body> label:

<! -- To use ckeditor, you must define class = "ckeditor" -->
<Asp: textbox id = "txtcontent" class = "ckeditor" textmode = "multiline" text = '<% # BIND ("info ") %> 'runat = "server"> </ASP: textbox>

Similar to other. Net controls, setting text = '<% # BIND ("info") %>' facilitates interaction with data sources.

3. Custom config. js

/*
Copyright (c) 2003-2009, cksource-Frederico knabben. All rights reserved.
For licensing, see license.html or http://ckeditor.com/license
*/

Ckeditor. editorconfig = function (config ){

// Define changes to default configuration here. For example:
Config. Language = 'zh-cn'; // configuration language
// Config. uicolor = '# fff'; // background color
// Config. width = 400; // width
Config. Height = 400; // height
Config. Skin = 'v2'; // editor Style

// Cancel the "drag to change the size" Function
Config. resize_enabled = false;

// Basic Toolbar
// Config. toolbar = "Basic ";

// All-Around Toolbar
// Config. toolbar = "full ";

// Customize the toolbar
Config. toolbar =
[
['Source', '-', 'preview'], ['cut ', 'copy', 'paste', 'pastetext ', 'pastefromword'], ['undo ', 'redo', '-', 'Find ', 'replace', '-', 'selectall', 'removeformat'], ['numberedlist ', 'bulletedlist', '-', 'outdent ', 'indent', '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'], ['maxilize ','-', 'about']
];

};

4, to streamline ckeditor can be _ samples, _ source folder Delete, Lang directory can only retain en. JS, Zh. JS, zh-cn.js three language files.

5. ckeditor does not provide the upload function. ckfinder must be integrated to implement the upload function.

Ckfinder 1.4.1.1 and ckeditor 3.0.1 are integrated in the following configuration methods:

Official Website: ckfinder (powerful and easy to use Ajax File Manager for Web browsers)

: Ckfinder 1.4.1.1 for Asp.net (updated 02.10.2009)

6. Download ckfinder_aspnet_1.4.1.1.zip and decompress it to ckfinder (in the root directory ).

7. Open "/ckfinder/config. ascx" and change the baseurl to baseurl = "~ /Ckfinder/userfiles /";
// Note "~"
// Use userfiles as the default path. subdirectories such as images and Flash are automatically generated under the directory.

8. Integrate ckfinder in ckeditor/config. js.

// Customize the ckeditor Style
Ckeditor. editorconfig = function (config ){
......
}

// Integrate ckfinder in ckeditor. Make sure that the ckfinder path is selected correctly.
Ckfinder. setupckeditor (null, '../ckfinder /');

9. Load ckfinder. js on the aspx page or master template page

<! -- Load the ckfinder JS file -->
<SCRIPT src = "../ckfinder. js" type = "text/JavaScript"> </SCRIPT>

Use ckfinder in the <body> label:

<! -- To use ckeditor, you must define class = "ckeditor" -->
<Asp: textbox id = "txtcontent" class = "ckeditor" textmode = "multiline" text = '<% # BIND ("info ") %> 'runat = "server"> </ASP: textbox>

Similar to other. Net controls, setting text = '<% # BIND ("info") %>' facilitates interaction with data sources.

10, can be _ samples, _ source folder to delete, Lang directory can only retain en. JS, Zh. JS, zh-cn.js three language files.

Common troubleshooting methods:

Symptom: files cannot be viewed due to security reasons. Contact the system administrator and check the ckfinder configuration file.

Statement:
Public override bool checkauthentication ()
{
Reture false;
}

Cause: user authentication is not set or the user is not logged on.

Symptom: Unknown error

Statement:
Public override bool checkauthentication ()
{
Reture true;
}

Cause: user authentication is not performed, but the baseurl path is incorrect.

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/E_wsq/archive/2009/12/12/4993742.aspx

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.