Simple configuration method for using FCKeditor in ASP. NET

Source: Internet
Author: User
The following is the information I collected from the Internet, including the problems I encountered in actual operations, especially the path settings.ProgramThe address in the development process is different from the address in the IIS cannot be found (I Don't Think So)
1. The official website of FCKeditor is:
Http://www.fckeditor.net/download
DownloadFckeditor2.4.2.zipAnd FCKeditor. Net (the latest version is recommended ).
2.After the data is extracted FCKeditor directoryCopy the entire file to the root directory of the website.

3.Decompress the fckeditor.net.zip package and find it in the FCKeditor. net_2.2 \ bin \ DEBUG directory.Fredck. fckeditorv2.dll. Other files are useless.Fredck. fckeditorv2.dllCopy to our website and createBin directory. (This step does not need to be done. The bin folder is automatically created after the DLL is added)

4.ReferenceFredck. fckeditorv2.dll.
Step 1:

Step 2:

5. Import the toolbox.
Under the toolboxRight-click

Click "select item ". Pop-up window:

ClickBrowse and find the directory where the DLL is located.

The FCKeditor Control is displayed in the toolbox.

6. DragFCKeditor to the page

7. Configure webconfig
<? XML version = "1.0"?>
<! --
Note: In addition to manually editing this file, you can also use
Web management tools to configure application settings. You can use
"Website"-> "ASP. NET configuration" option.
The complete list of settings and comments is displayed in
In machine. config. Comments, this file is usually located in
\ Windows \ Microsoft. NET \ framework \ v2.x \ config
-->
<Configuration>
<Deleetask>

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

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

</Appsettings>

<Connectionstrings/>
<System. Web>

Note: I always reported an error at the beginning, saying that XML cannot be parsed. Later I found that the path was set incorrectly. At the beginning, I set FCKeditor: set the value of userfilespath to "/files/". Then I changed it to = "~ /Files/"No problem. It is estimated that you have to modify the path after you cannot send IIS.
Below is an articleArticleAbout setting the IIS address that cannot be sent:
The following is another person's explanation of the path, which I have followed and fails every time.
Basepath
It is the path where FCKeditor is located. FCKeditor can be written in this way directly under the website directory. If your website has more layers, make appropriate adjustments.
UserfilespathIs the directory of all uploaded files.Why set to/files?This is not ~ /FilesBecauseFCKeditorUse this value to return the relative path of the uploaded file to the client. Otherwise, the user will retrieve the user's machine directory instead of the HTTP directory during access.

8. The files directory must have the write permission. You can set the account based on your website requirements. This document makes it more reasonable to use an ASP. NET account to set the user conveniently.

 

9. Modify the FCKeditor/fckconfig. js file.
At the position of Row 3
VaR _ filebrowserlanguage = 'asp '; // ASP | aspx | CFM | lasso | Perl | PHP | py
VaR _ quickuploadlanguage = 'asp '; // ASP | aspx | CFM | lasso | PHP
Change
VaR _ filebrowserlanguage = 'aspx '; // ASP | aspx | CFM | lasso | Perl | PHP | py
VaR _ quickuploadlanguage = 'aspx '; // ASP | aspx | CFM | lasso | PHP

10.FCKeditorGive itSlimming. All headers starting with _ are sample files or source files, but we recommend that you be careful.

Possible problems:
1. FCKeditor "this connector is disabled please check the"... "error Solution

Code
Solution:

Open Editor/Filemanager/Connectors/Aspx/Config. ascx: Modify the checkauthentication () method. True is returned.

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 very simple
//
// Return (session ["isauthorized"]! = NULL & (bool) session ["isauthorized"] = true );
//
// Where session ["isauthorized"] is set to "true" as soon as
// User logs in your system.

Return   True ;
}

 

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.