The configuration method of FCKeditor 2.6.4 in asp.net

Source: Internet
Author: User

1, fckeditor official download address: Http://www.fckeditor.net/download.

2, FCKeditor 2.6 download Address:

Http://sourceforge.net/project/downloading.php?group_id=75348&filename=FCKeditor_2.6.zip.

3, DLL file download address:

http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=137125.

The configuration method is as follows:

First, on the official website to download the extracted directory structure as shown in the following figure:

Ii. deletion of unnecessary documents
From the official download down the size of the FCKEditor2.6 3.61M (after decompression), in fact, there are a lot of files for use only asp.net is not necessary, we can delete unnecessary files:
1. In the root directory, in addition to the editor directory, Fckconfig.js, Fckeditor.js, Fckstyles.xml, fcktemplates.xml These several reservations, the rest of the total deletion
Delete all except ASPX directory in 2.editor/filemanager/connectors directory
Delete all except En.js, Zh.js, zh-cn.js in 3.editor/lang directory
4. Delete the _samples directory, of course, if you want to see the example, do not delete this directory.

Third, the detailed setting of FCKEditor2.6
Modified in 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.
] ;
The above section I removed some of the less commonly used functions, can be increased according to actual needs.


Fckconfig.defaultlanguage = ' ZH-CN '; It turns out to be en.
var _filebrowserlanguage = ' aspx '; ASP | aspx | CFM | Lasso | Perl | php | PY changed to ASPX
var _quickuploadlanguage = ' aspx '; ASP | aspx | CFM | Lasso | Perl | php | Py
2. Add DLL file to Bin

Note: Download the address from the DLL file provided above:

http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=137125 Download Fckeditor.net_2.6.3.zip Compression package, After decompression, copy the two files in the fckeditor.net_2.6.3/bin/debug/2.0 directory to the Bin folder of your Web site.


3. Configure the Upload path
Edit Fckeditor/editor/filemanager/connectors/aspx/config.aspx Modify
private bool Checkauthentication ()
{
Warning:do not simply return "true". By doing so, your are allowing
"Anyone" to upload and list the files in your server. You must implement
Some kind of 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; It turns out this is false, but it's recommended to look at the warning.
}

4, the Webconfig file configuration

<appSettings>

<add key= "Fckeditor:basepath" value= "~/fckeditor/"/>

<add key= "Fckeditor:userfilespath" value= "~/upload/fckeditor/"/>//I set it up in the Upload/fckeditor directory under the root directory of the Web site, Depending on the actual situation and personal preferences.

</appSettings>

L We know that a folder cannot hold too many files under it (it is said that 2000 of the directory under Windows is a threshold), otherwise access to the directory can severely affect I/O performance. The FCKeditor file Store is in a single directory. I have extended the fckeditor to customize the format of the storage directory in Web.config appsettings:

Take today's date as an example: the resulting file Upload subdirectory format is: 2008/10-21/.

<add key= "Fckeditor:folderpattern" value= "%y/%m/%d/"/>

L zoom in on uploaded images

A lot of the content is published in the scene where FCKeditor pictures are uploaded. The content often does not need thousands of pixel size picture, for example my project, the article area is widest also is 560 pixels, so I have made an extension, in Web.config appsettings can customize the maximum width of the picture:

<add key= "fckeditor:maxwidthofuploadedimg" value= "560"/>

IV, use the editor to a simple example in the project

You can first add the FCKeditor editor space to the Toolbox: Right-click Tab-"Select Item"-"Browse"-"Add OK", and then drag the FCKeditor control into the page.

The following is a simple fcktest.aspx page:

<%@ Page language= "C #" autoeventwireup= "true" codefile= "FckTest.aspx.cs" inherits= "Fcktest"%>

<%@ Register assembly= "Fredck.fckeditorv2" namespace= "Fredck.fckeditorv2" tagprefix= "FCKeditorV2"%>

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<title> Untitled Page </title>

<body>

<form id= "Form1" runat= "Server" >

<div>

<fckeditorv2:fckeditor id= "onlinkeditor" runat = "server" ></FCKeditorV2:FCKeditor>

</div>

</form>

</body>

How to get its content. Read the Value property of the Onlinkeditor control.

V. Configure under IIS ( when urlrewrite technology is used)

IIS forXP uses this setting:

IIS configuration: Web site-> Properties-> Directory-> configuration (G) ...-> mapping-> Application Extensions-> add
Executable: C: "Windows" microsoft.net "framework" v2.0.50727 "Aspnet_isapi.dll
Name extension:. html
Action: limited to Get,head,post,debug
Scripting engine: Checking
Confirm file exists: not selected

IIS for2003 uses this setting:

IIS configuration: Web site-> Properties-> Directory-> configuration (G) ...-> mapping-> Wildcard application mappings (Order of execution)-> insert
Executable: C: "Windows" microsoft.net "framework" v2.0.50727 "Aspnet_isapi.dll
Confirm file exists: not selected

Vi. Common Mistakes

FCKEditor 2.6 Question:

1. FCKeditor appears "This connector are disabled please check

The "editor/filemanager/connectors/aspx/config.aspx" Error Solution:

Open Editor/filemanager/connectors/aspx/config.ascx Modify Checkauthentication () method, return True

C # code:

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&NBSP;VERY&NBSP;SIMPLE&NBSP;AS&NBSP
//
//         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;
}

2, the website uses the Urlrewrite technology the situation, may encounter such question "to find the resources." Description: HTTP 404. The resource you are looking for (or one of its dependencies) may have been removed, or its name has changed, or is temporarily unavailable. Please check the following URL and make sure it is spelled correctly.
Requested URL:/fckeditor/editor/fckeditor.aspx "Workaround is as follows:

pseudo-static setup process:

1. Open the IIS Admin panel;

2. Select the virtual directory of your own website;

3. Right-key properties, select Home Directory, as shown in the figure:

4. Select "Configuration" as shown in the picture:

found that the entire site's pseudo static has been set up.

5. Then find the FCK directory FCKeditor, right-click "Properties", as shown in the figure:

6. Click "Create", as shown in the picture:

Determine the end.

7. Click "Configure" again to find the. HTML rules, delete.

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.