Configuration of FCKeditor in ASP. NET

Source: Internet
Author: User
After years of web development, FCKeditor is the best online editor I have ever used. It is also the best editor on the Internet. It has powerful functions and supports multiple browsers,
No platform restrictions, can be integrated with a variety of Web languages, multi-language support, but also supports open source! ^-^

It is so powerful that it is not very easy to get started when I use it. Every time I change the new version, I always spend some time to familiarize myself with and configure it, which is quite inconvenient. So today
Write this document to facilitate future query.

The environment is described in Asp.net development. The steps are as follows:
1. Get files
We can
And DLL files, we copy the DLL to the bin directory and add the DLL to the toolbox for ease of use. The other is FCKeditor 2.6, which contains FCKeditor
Script files, styles, languages, and other miscellaneous of FCKeditor. We can streamline it and copy it to the Web root directory.

2. Simplified FCKeditor
FCKeditor supports multiple web languages. We can simplify the language we use, delete unused files, decompress fckeditor_2.6, and enter
In the FCKeditor folder, delete all the folders starting with "_". These folders contain examples or other tools. In fact, it is reserved only.
The Editor folder, fckconfig. JS, FCKeditor. JS, fckstyles. XML, and fcktemplates. XML can be simplified at the outermost layer.
Go to the Editor folder and delete the "_ source" folder first. Here are some source files, which are useless for use. Go to the Lang folder.
Is the editor language outsourcing files, only keep the zh-cn.js, en. JS, Zh. js these files, the meaning of these files I want everyone to know. Of course, if you need other
The language can also be left.

Go to the skin folder. This is the editor's skin. If you want to use the FCKeditor's default milk yellow color, consider it if you want to use something else. Office2003
The skin is pretty, I heard that loading speed is relatively slow, you can also choose the silver, it is better color, speed is also fast.
In the last step of streamlining, exit the skin folder, go to filemanager, go to the connectors directory, keep the aspx directory, and delete all others.
Now it looks pleasing to the eye!

3. Configure the editor,
You cannot correctly run the editor control by dragging it to the webpage. You must configure it. The first configuration file is fckconfig. JS, which is located in the root directory of FCKeditor.
. Modifications include:
Fckconfig. skinpath = fckconfig. basepath + 'Skins/silver/'; (skin)
Fckconfig. autodetectlanguage = true; (automatic language detection)
Fckconfig. defaultlanguage = 'zh-cn'; (Simplified Chinese by default)
Select Aspx.
VaR _ filebrowserlanguage = 'aspx '; // ASP | aspx | CFM | lasso | Perl | PHP | py (used to browse and upload files)
VaR _ quickuploadlanguage = 'aspx '; // ASP | aspx | CFM | lasso | Perl | PHP | py (used to upload files)
If you want to set the editor's browsing functions, such as browsing images and flash, to set the upload function, and uploading parts and Flash files, you can set it to enable or disable, and true to enable

False.
Fckconfig. linkbrowser = true;
Fckconfig. imagebrowser = true;
Fckconfig. flashbrowser = true;
Fckconfig. linkupload = true;
Fckconfig. imageupload = true;
Fckconfig. flashupload = true;

If your editor is still used at the front-end of the website, for example, for message books or diary replies, you have to consider security. Do not use default at the front-end.
Toolbar, either a custom function, or other dangerous functions such as basic defined by the system, disabling file upload, etc. You can also choose
Suitable for your own functions. As for how to choose, you can compare the fckconfig. toolbarsets ["default"] And fckconfig. toolbarsets in the fckconfig. js file.
["Basic"] configuration should be easier. No need to explain!

4. File Upload settings
When uploading a file, we want to upload the file to the specified directory, and it must be a verified user to upload the file. We can
In the config. ascx file in the filemanager \ connectors \ aspx directory, we can
In the checkauthentication () method, add authentication to the current user. If the authentication succeeds, return true. In the setconfig () method, you can set userfilespath to indicate
Specifies the path to save the uploaded file. The uploaded files can be automatically saved to the corresponding directory by directory, such as file, image, Flash, and media. The configured structure is as follows:
Userfilespath = "~ /Upload/", in the upload directory under the Web root directory.
~ /Upload
|-File
|-Image
|-Flash
|-Media

5. Run the editor.
Put the streamlined FCKeditor in the web root directory, and set the FCKeditor Control on the page using the relative path,
<Fckeditorv2: FCKeditor id = "fckeditor1" runat = "server" basepath = "~ /FCKeditor/">
</Fckeditorv2: FCKeditor>
Control property toolbarset = default or basic. After setting, you can run the tool. For other configuration information, go to http://docs.fckeditor.net.

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.