FCKeditorIntroduction:
Official WebsiteHttp://www.fckeditor.net/
Official documentationHttp://wiki.fckeditor.net/
Http://www.fckeditor.net/download/default.html
Official demoHttp://www.fckeditor.net/demo/default.html
ForASP. NETFor developers, you have two options:
1.Use onlyFCKeditor, DownloadHttp://sourceforge.net/project/showfiles.php? Group_id = 75348 & package_id = 75845And then configure the coreJSFile. This is not the topic discussed in this article.
2.UseFCKeditor. net, DownloadHttp://sourceforge.net/project/showfiles.php? Group_id = 75348 & package_id = 137125. It must be declared that this file is onlyASP. NETWidgetDLLFile, not includingFCKeditorEditor kernel. So you should also download the file package mentioned in the previous method.
The following is a combinationASP. net2.0Project to see detailsFCKeditor. DownloadFCKeditorPackages andFCKeditor. netServer Control. EnableVs2005CreateC #OfWeb SiteProject, namedFckpro.
FCKeditorInstallation:
The so-called installation is a simple copy process.
DownloadFckeditor_2.2.zipDecompress the package directlyFckproIn the root directoryFCKeditorFolder, which is rich in allFCKeditor.
Then downloadFckeditor.net_2.2.zipDecompress the package to an empty directory on your hard disk.FCKeditor. netOfSource code(Based on. Net1.1OfC #Project), you can useVs2003To re-develop it. This article does not cover this content, but we just use it directly.FCKeditor. netUnder the project directory\ Bin \ releaseDirectoryFredck. fckeditorv2.dllFile.
InVs2005AddFredck. fckeditorv2.dllReferences:
1. right-click fckpro Project browser, select Add reference ( Add reference... ), locate the (Browse) tag, then locate the unzipped fredck. fckeditorv2.dll . At this time, fckpro A bin folder is added to the project directory, it contains fredck. fckeditorv2.dll file. Of course, you can also do this manually by putting fredck. fckeditorv2.dll directly copy to fckpro \ bin \ , vs2005 it is automatically compiled during compilation.
2.For convenienceRadDevelopment, we putFCKeditorControl is also addedVSToolbox (Toolbox), Expand the common label groups of the Toolbox (General), Right-click the component (Choose items...In the dialog box, locate the Browse button.Fredck. fckeditorv2.dllAnd then confirm. The toolbox is displayed.
My experience tells me that this will save a lot of effort in development.FCKeditorDeclaration to be added when controlsCode.
Now you have completedFCKeditorAnd can be used in your project.FCKeditorOf course there are many things to be configured later.
FCKeditorInASP. net2.0 WebConfiguration in the project:
now, I will apply FCKeditor to our project. Open default. aspx , switch to the design mode ( Design ), drag the FCKeditor control from the toolbox, on the default page, you can see FCKeditor , however, only one FCKeditor station frame is displayed, and the running effect is not displayed, select fckeditor1 and click property ) you can set the FCKeditor Object Some basic attributes. basepath attribute, if FCKeditor is set to FCKeditor , set it to ~ /FCKeditor/ . If it is another directory name, replace it with the corresponding value (note: the default value of the control is /FCKeditor/ , because the runat = "server" attribute is set in the server control basepath = "~ /FCKeditor/" ). Set default. aspx switch to source code mode ( source ), we can see ide automatically generated code:
<%@Register Assembly= "Fredck. fckeditorv2"Namespace= "Fredck. fckeditorv2"Tagprefix= "Fckeditorv2"%>
<Fckeditorv2:FCKeditorID= "Fckeditor1" Runat= "Server"> </Fckeditorv2:FCKeditor>
IfFCKeditorAdd the code to the Toolbox manually after adding the reference.
In source code mode, place the cursor inFckeditorv2:FCKeditorLabel content is displayed in bold, and the attribute panel displaysFCKeditorAll the attributes of the server control 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 haveASPUseFCKeditorExperience, you should understand the meaning of some of these attributes, andFckconfig. js. I will sort it out later. It must be noted thatFckeditor2.2OfFckconfig. jsAnd2.0The version has been greatly improved, the size is smaller, and the configuration method is more flexible. Please download and compare it by yourself.
For this example, the configuration code is as follows:
<Fckeditorv2:FCKeditor
ID= "Fckeditor1"
Runat= "Server"
Autodetectlanguage= "False"
Defaultlanguage= "ZH-CN"
Basepath= "~ /FCKeditor/">
</Fckeditorv2:FCKeditor>
Okay. Now, run this page to allow modification.Web. config(This wayIDEAWeb. configFile ). See the results!
Someone may ask: how to getHTTP Error 404-not found.? The error is generallyBasepathNot set correctly. refer toBasepathCheck the precautions carefully!
Here,FCKeditorThe configuration is not really completed, because we have not configured a powerful function in it: file upload.
InDefault. aspxIn running mode, clickFCKeditorInsert/Edit image "(orFlash) Function, click "Browse server" in the pop-up box, and a dialog box pops up. An error prompt box appears.XML request error: forbidden (403 ).
The following error occurs:WebAll developers know403It should be about read/write permissions. But why? The reason is that there is no ConfigurationUserfilesPath.
InFckproCreate an empty directory under the root directoryFiles. TogetherBasepathThe general practice of setting is as follows:
OpenFckproEngineeringWeb. configFile, modifyAppsettingsThe configuration is as follows:
<Appsettings>
<Add Key="FCKeditor: basepath" Value="~ /FCKeditor/"/>
<Add Key="FCKeditor: userfilespath" Value="/Fckpro/Files"/>
</Appsettings>
Set FCKeditor: basepath Then you do not need to use FCKeditor Instance Basepath Attribute, FCKeditor: userfilespath The directory where all uploaded files are created. You may ask why you want to set /Fckpro/Files Instead ~ /Files Because FCKeditor Use this value to return the relative path of the uploaded file to the client, ~ /Files The format is ASP. NET It can be compiled and explained in the service, but the static state on the client does not understand what this is. If you use ~ /Files Then, all the paths returned for the uploaded files are ~ /Files Form, you will get such a link Http ://~ /Files/image/logo.gif The path is found. So we need to set it like above. This is in the development stage. If the project is released after completion, remember /Fckpro/Files Change /Files The reason is that everyone understands the development stage. Vs2005 When running the project URL Yes Http: // localhost/Project name/ In the form Server Create a site on, and the path is Http://www.abc.com/ So it must be changed after the release. These are in use Fckeditor2.2 + ASP. net2.0 Errors often occur and the place where the cloud is located is unknown.
Don't be happy first. This upload function is still the most crucial step. InFCKeditorUnder the root directory (Fckpro/FCKeditor/) FindFckconfig. jsFile, open it in a text editor.132Find the line (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
Set the values of the two rowsASPChangeAspx, Save and close the file.
Okay, you're done! Run hereFckproProject, use the browsing server function,OKRight?
I would like to mention:
When using the file upload function during development XML request error: internal server error (500)The solution to the error.
Encounter500What is an internal error?
BecauseASP. net2.0AddedThemeFunction, So if youWeb. configUsedStylesheetthemeOrThemeOfThen you need to modify it more.
OrFCKeditorDirectory to open\ Editor \ filemanager \ upload \ aspx \ upload. aspxAnd\ Editor \ filemanager \ browser \ Default \ connectors \ aspx \ connector. aspxTwoAspxFile, inPageLabelTheme = ""OrStylesheettheme = ""You can modify anything you use in the project. 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= "" %>
This solves the problem.500Internal error.