Preparation: DownloadProgramPackage (1): FCKeditor. Net Package and fckeditor_2.x.x package
I. Preparations
First download FCKeditor v2.3.2 released, on it. This compressed package does not contain the DLL control to be used by. net, so you need to download another compressed package, in the above control address. Decompress the first file to the web root directory. The default folder is FCKeditor. decompress the second package, which containsSource codeIf you want to develop it again, double-click fredck. fckeditorv2.csproj file, open.. net. The language used is C #. If you do not want to modify it, directly change the fredck under bin \ release. copy the fckeditorv2.dll file to the bin in the web directory.
Ii. Streamline files
Because only ASP. NET is used, it is necessary to streamline the file.
Go to the FCKeditor folder and delete all files and folders starting with "_". These are examples. Only the Editor folder and fckconfig are retained. JS, FCKeditor. JS, fckstyles. XML, fcktemplates. XML is enough;
Go to the Editor folder and delete the "_ source" folder, which also contains the source file;
Go back to the upper-level directory and enter the filemanager folder. There are two folders: browser and upload. Go to browser \ Default \ connectors. Only the aspx folder is retained, and the rest are deleted. The mcpuk directory can also be deleted. The same is true for upload, and only the aspx folder is retained;
Return to the editor and enter the images folder. The smiley folder contains emoticon icons, including MSN and fun. If you want to use your own emoticon icons, you can delete them; if you want to use the emojis here, do not delete them;
Lang contains a Language Pack. If only simplified Chinese characters are used, only fck1_agemanager is retained. JS, zh-cn.js two files on the line, it is recommended to keep en. JS (English), Zh. JS (Traditional Chinese) files, fck1_agemanager. JS is a language configuration file. With it, it can be used with fckconfig. JS settings are paired, corresponding to the corresponding language file, must be retained!
Exit the Lang folder and enter the skins folder. If you want to use the default FCKeditor milk yellow, delete the other two folders except the default folder. If you want to use other folders, it depends on your preferences.
So far, the file has been streamlined, from the original 2.55m to the current 797k. Then modify the settings.
3. Modify settings
Open the fckconfig. js file in the root directory. Fckconfig. skinpath = fckconfig. basepath + 'Skins/default/'; this line sets skin. If silver is retained during streamlining, change the path to skins/silver. By default, fckconfig does not care about it. defaultlanguage = 'en'; set the default language and change en to ZH-CN, that is, simplified Chinese; fckconfig. tabspaces = 0; if you need to use the tab key during editing, change 0 to 1;
In. . Net. Change ASP in JS to aspx (default file browser language, fast upload LANGUAGE)
Save the changes. FCKeditor fully supports ASP. NET. Of course, there are still some security issues, as long as you modify the corresponding toolbar, right-click the menu, and so on, because my background does not face the front-end users, that is, there is no message book or reply to the diary, so skip these steps. The next step is to open vs. NET and add FCKeditor to the ASP. NET page.
Iv. ASP. NET Applications
Open the "Resource Manager" of the project and add the "fredck. fckeditorv2" reference. Create a page and add fck references,CodeAs follows:
<% @ Register tagprefix = "fckeditorv2" namespace = "fredck. fckeditorv2" assembly = "fredck. fckeditorv2" %>
Make sure that the values of "autoeventwireup" and "validaterequest" in @ page are both false. Otherwise, when you postArticle. NET will warn you of security risks and errors when it contains links or other HTML statements. Add the FCKeditor Control to the proper position of the Form. Of course, the form must have "runat =" server "". The Code is as follows:
<Fckeditorv2: FCKeditor id = "content" runat = "server"> </fckeditorv2: FCKeditor>
If an error occurs when you insert an image, follow these steps:
FCKeditor configuration highlights
1. You can set the fckconfig. js file in the directory to replace ASP with Aspx.
2. Add
<Deleetask>
<Add key = "FCKeditor: userfilespath" value = "/FC/fserfiles/"/>
<Add key = "FCKeditor: basepath" value = "/FC/FCKeditor/"/>
</Appsettings>
Note: The virtual directory and fceditor website directory path
3. reference the DLL package of FCKeditor to the project.
4. the most critical step is to grant the permissions of Asp.net users to the largest
5. File Header reference namespace
<% @ Register tagprefix = "fckeditorv2" namespace = "fredck. fckeditorv2" assembly = "fredck. fckeditorv2" %>
6. Introduce FCKeditor
<Fckeditorv2: FCKeditor id = "fckeditor1" basepath = "./FCKeditor/" runat = "server"> </fckeditorv2: FCKeditor> </font>
7. If not
Editor/filemanager/Browser/connectors/aspx/connectior. in the aspx header, add theme = "" to the reference package file, as shown in the following figure. to find the aspx file in the upload folder of the browser directory.
<% @ Page Language = "C #" inherits = "fredck. fckeditorv2.filebrowserconnector" autoeventwireup = "false" theme = "" %>
Note:
I. Solve Chinese problems in addition to the Web. To write the gb2312 identifier in config
FCKeditor/Editor/filemanager/Browser/default/frmresourceslist.html
Change seturl (fileurl) in function openfile to seturl (escape (fileurl ));
In addition, the editor directory under the dialog under the FCK--IMAGE and FCK--FLASH, etc.
<Metahttp-equivxxxxxxxxcharset = UTF-8> change to gb2312
Ii. Pay attention to reference the fck style sheet and JS file when using it. Otherwise, the display may be abnormal or the function may be abnormal.