I. Preparations
First download the latest FCKeditor v2.3,: http://prdownloads.sourceforge.net/fckeditor/FCKeditor_2.3.zip? Download; this compressed package does not contain ASP. NET to use dll Control, so also download another compressed package,: http://sourceforge.net/project/showfiles.php? Group_id = 75348 & package_id = 137125. 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. If you do not want to upload files, delete filemanager.
At this point, the file has been streamlined from 2.55m to 689k. Then modify the settings.
3. Modify settings
Open the fckconfig. js file in the root directory.
Fckconfig. skinpath = fckconfig. basepath + 'Skins/default/'; this line is set to skin. If silver is retained during streamlining, change the path to skins/silver. By default, you don't need to worry about it;
Fckconfig. defaultlanguage = 'en'; set the default language and change en to ZH-CN, Which is simplified Chinese;
Fckconfig. tabspaces = 0; if you need to use the tab key during editing, change 0 to 1;
Because FCKeditor is ASP by default, You need to replace it with ASP. NET. Comment out ASP and otherCodeDelete and use ASP. NET instead. For example:
VaR _ filebrowserlanguage = 'aspx'
VaR _ quickuploadlanguage = 'aspx'
The rest of the Code follows the above steps to delete other Web languages and only retain ASP. NET. You can also click here to download my simplified files. Note: This is only applicable to ASP. NET. Do not use other languages! We recommend that you decompress the file to another directory and copy it to the corresponding location of the web directory to avoid file loss.
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.
Open addArticleManage the document corresponding to the document to modify the content. The following uses "add an article" as an example. Switch to the "html" interface and add the fck reference. The Code is as 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 your post contains links or other HTML statements ,. net will warn you of security risks and errors. 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>
You can name the ID by yourself. IfProgramIf the input is null, it is no longer content. text, but content. value.
So far, the file has been modified. All code is as follows:
Program code <% @ page Language = "C #" codebehind = "adminfileadd. aspx. cs" autoeventwireup = "false" inherits = "myblog. admin. adminfileadd" validaterequest = false %>
<% @ Register tagprefix = "fckeditorv2" namespace = "fredck. fckeditorv2" assembly = "fredck. fckeditorv2" %>
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
<Title> adminfileadd </title>
<Meta content = "Microsoft Visual Studio. NET 7.1" name = "generator">
<Meta content = "C #" name = "code_language">
<Meta content = "JavaScript" name = "vs_defaultclientscript">
<Meta content = "http://schemas.microsoft.com/intellisense/ie5" name = "vs_targetschema">
<Link href = "admin.css" type = "text/CSS" rel = "stylesheet">
</Head>
<Body class = "right">
<Form ID = "form1" method = "Post" runat = "server">
<Div> add an article </div>
<Div class = "Main">
<Ul>
<Li>
Title: <asp: textbox id = "title" runat = "server" maxlength = "50" width = "250px"> </ASP: textbox>
<Li>
Topic: <asp: dropdownlist id = "M" runat = "server" autopostback = "true"> </ASP: dropdownlist>
<Li>
<Fckeditorv2: FCKeditor id = "content" runat = "server"> </fckeditorv2: FCKeditor>
<Li>
<Asp: button id = "add" runat = "server" text = "Submit"> </ASP: button>
</LI>
</Ul>
</Div>
</Form>
</Body>
</Html>