FCKeditor 2.2 settings

Source: Internet
Author: User

FCKeditor introduction:

Official Website http://www.fckeditor.net/

Official Document http://wiki.fckeditor.net/

Http://www.fckeditor.net/download/default.html

Official demonstration http://www.fckeditor.net/demo/default.html

For ASP. NET developers, you have two options:

1. Just use FCKeditor, download http://sourceforge.net/project/showfiles.php? Group_id = 75348 & package_id = 75845
,
Then configure several core JS files. This is not the topic discussed in this article.

2. Use FCKeditor. Net to download the http://sourceforge.net/project/showfiles.php? Group_id = 75348 & package_id = 137125
.
It must be declared that this file is only an ASP. NET control DLL file, and does not include the FCKeditor editor kernel. So you should also download the file package mentioned in the previous method.

 

The following describes how to install and configure FCKeditor in combination with an ASP. net2.0 project. Download the FCKeditor package and
FCKeditor. NET Server Control. Enable vs2005 to create a C # web site project named fckpro.

 

FCKeditor installation:

The so-called installation is a simple copy process.

Decompress the downloaded fckeditor_2.2.zip package to the root directory of fckpro, so that the root directory will get a FCKeditor folder, which is rich.
Contains all FCKeditor core files.

Then decompress the downloaded fckeditor.net_2.2.zip file to an empty directory on your hard disk, which contains the source code of FCKeditor. Net (
In the C # project of. net1.1), you can use vs2003 to re-develop it. This article does not cover this content. We just use the FCKeditor. Net project directory directly.
In the/bin/release directory of. fckeditorv2.dll.

Add a reference to fredck. fckeditorv2.dll in vs2005:

1. Right-click the fckpro project browser and choose add
Reference ...), Find the Browse tab, locate the extracted fredck. fckeditorv2.dll, and click OK. This
The fckpro project directory contains a bin folder containing the fredck. fckeditorv2.dll file. Of course, you can do this manually.
Fredck. fckeditorv2.dll is directly copied to fckpro/bin/. vs2005 will automatically compile it during compilation.

2.
To facilitate rad development, we also add the FCKeditor Control to the toolbox of Vs, expand the common label Group of the Toolbox (general), right-click the group
Choose items ...), Find the Browse button in the dialog box, locate fredck. fckeditorv2.dll, and then confirm. The toolbox is displayed.

My experience tells me that this will save a lot of declaration code to be added when using the FCKeditor Control during development.

 

So far, you have completed FCKeditor installation and can use FCKeditor in your project. Of course there are many things to be configured later.

 

Configuration of FCKeditor in ASP. net2.0 web project:

Now, I will apply FCKeditor to our project. Open default. aspx, switch to design, and Control FCKeditor
You can see the FCKeditor on the default page by dragging it down from the toolbox. However, you can only see the position box of one FCKeditor but not the runtime
After selecting fckeditor1, you can set some basic properties of this FCKeditor object on the property panel. More importantly
Basepath attribute. If FCKeditor is set to FCKeditor in the root directory, set it ~ /FCKeditor/. If it is another directory name, replace it
Value (Note: The default value of the control is/FCKeditor/, because we use the Server Control to set the runat = "server" attribute, so an explicit declaration is required.
Basepath = "~ /FCKeditor /"). Switch default. aspx to source. We can see the code automatically generated by IDE:

<% @ Register Assembly = "fredck. fckeditorv2"
Namespace = "fredck. fckeditorv2" tagprefix = "fckeditorv2" %>

 

<Fckeditorv2: FCKeditor id = "fckeditor1"
Runat = "server"> </fckeditorv2: FCKeditor>

 

If you didn't add FCKeditor to the toolbox, You Should manually add the code after adding the reference.

In source code mode, place the cursor over the fckeditorv2: FCKeditor TAG content, which is displayed in bold. The FCKeditor service is displayed on the property panel.
All the attributes of the widget are much more than in the design mode.

Attribute list:

 

Autodetectlanguage

Basehref

Basepath

Contentlangdirection

Customconfigurationspath

Debug

Defaultlanguage

Editorareacss

Enablesourcexhtml

Enableviewstate

Enablexhtml

Fillemptyblocks

Fontcolors

Fontformats

Fontnames

Fontsizes

Forcepasteasplaintext

Forcesimpleampersand

Formatindentator

Formatoutput

Formatsource

Fullpage

Geckousespan

Height

ID

Imagebrowserurl

Linkbrowserurl

Pluginspath

Runat

Skinpath

Startupfocus

Stylesxmlpath

Tabspaces

Toolbarcancollapse

Toolbarset

Toolbarstartexpanded

Usebroncarriagereturn

Value

Visible

Width

Event list:

 

Ondatabinding

Ondisposed

Oninit

Onload

Onprerender

OnUnload

The usage of the above attributes and events will not be repeated here. Please explore it by yourself. At present, I have not found any relevant information, but it is not very difficult, if you use FCKeditor in ASP
Experience, you should understand the meaning of some of these attributes, which is the same as the setting items of fckconfig. js. I will sort it out later. It must be noted that
Fckeditor2.2 fckconfig. js and fckeditor2.2 have been greatly improved, with smaller sizes and more flexible configuration methods. For details, please download and compare them on your own.

For this example, the configuration code is as follows:

<Fckeditorv2: FCKeditor

Id = "fckeditor1"

Runat = "server"

Autodetectlanguage = "false"

Defaultlanguage = "ZH-CN"

Basepath = "~ /FCKeditor/">

</Fckeditorv2: FCKeditor>

Now, run this page to allow you to modify web. config (in this way, the IDE will automatically add a web. config file under the project ). See the results!

Someone may ask: how to get an HTTP Error 404-not
Found. error? This error is generally caused by incorrect basepath settings. Refer to the basepath precautions mentioned above and check carefully!

At this point, the configuration of FCKeditor is not actually completed, because it contains a powerful feature we have not configured correctly: file upload.

In the default. aspx running mode, click the "insert/edit image" (or flash) function of FCKeditor. In the pop-up box, click "Browse server ".
In a dialog box, an error prompt box is displayed: XML request error: forbidden (403 ).

If you get such errors, web development experience knows that 403 should be a read/write permission problem. But why? The reason is that the userfiles path is not configured.

Create an empty directory named files in the root directory of fckpro. The common practice of setting basepath together with basepath is as follows:

Open the Web. config file of the fckpro project and modify the appsettings element. The configuration is as follows:

<Deleetask>

<Add key = "FCKeditor: basepath" value = "~ /FCKeditor/"/>

<Add key = "FCKeditor: userfilespath" value = "/fckpro/Files"/>

</Appsettings>

After FCKeditor: basepath is set, you do not need to specify the basepath attribute every time you use the FCKeditor instance.
FCKeditor: userfilespath is the directory where all the uploaded files are located. You may ask why you want to set it to/fckpro/files.
No ~ /Files, because FCKeditor uses this value to return the relative path of the uploaded file to the client ,~ /Files can be compiled by ASP. NET in the service.
But the static client does not understand what this is. If you use ~ /Files, the returned paths of all uploaded files are ~ /Files, you will get the link http ://~ /Files/image/logo.gif
This
The link solution is to find the path. So we need to set it like above. This is in the development phase. If the project is released after completion, remember to change/fckpro/files to/files,
If you do not know the reason, you also understand that during the development stage, the URL of vs2005 when running the project is http: // localhost/
Item
Object Name/form, after the release of the site on the server, with the path is the http://www.abc.com/
Of
Form, so you must change it after release. These are common errors that occur when fckeditor2.2 + ASP. net2.0 is used, and the cloud is unknown.

Don't be happy first. This upload function is still the most crucial step. In the root directory of FCKeditor (fckpro/FCKeditor/), find
Open the fckconfig. js file in a text editor and find it in around 132 lines (probably because you may have changed this file by referring to other materials:

 

VaR _ filebrowserlanguage = 'asp '; // ASP | aspx | CFM |
Lasso | Perl | PHP | py

VaR _ quickuploadlanguage = 'asp '; // ASP | aspx | CFM | lasso |
PHP

 

Change the value of the values of the two row assignment codes from ASP to aspx and save and close the file.

Okay, you're done! Run the fckpro project here and use the Browser Server function. OK?

 

I would like to mention:

XML request error: internal server error (500)
The solution to the error.

What is the internal Error 500?

Because ASP. net2.0 adds theme, if you use stylesheettheme or
If theme is used, you need to modify it more.

To the directory where FCKeditor is located, open/Editor/filemanager/upload/aspx/upload. aspx and
/Editor/filemanager/Browser/default/connectors/aspx/connector. aspx two aspx
File. Add theme = "" Or stylesheettheme = "" to the page tab to modify the theme. The modification is as follows:

<% @ Page Language = "C #" inherits = "fredck. fckeditorv2.uploader"
Autoeventwireup = "false" theme = "" %>

Or

<% @ Page Language = "C #" inherits = "fredck. fckeditorv2.uploader"
Autoeventwireup = "false" stylesheettheme = "" %>

In this way, the internal Error 500 is solved.

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.