FCKeditor is currently the best HTML text editor. If you still don't understand it, you will understand it.
:
Why is FCKeditor cold? This is not a big bang, it is a little troublesome to use, the following details how to deal with this stuff.
1. FCKeditor official website is: http://www.fckeditor.net/download
FCKeditor 2.4.2 is the latest version.
Please download on this page: http://sourceforge.net/project/showfiles.php? Group_id = 75348
:
Download two zip packages, fckeditor2.4.2.zip and FCKeditor. net.
Note:
Fckeditor2.4.2.zip is the latest Javascript file and image;
Fckeditor.net.zip is the DLL called by ASP. NET.
2. Copy the FCKeditor directory in fckeditor2.4.2.zip to the website.
3.decompress the fckeditor.net.zip package and find fredck. fckeditorv2.dll in the FCKeditor. net_2.2/bin/DEBUG directory. Other files are useless. Copy fredck. fckeditorv2.dll to our website and create a bin directory.
4. Reference fredck. fckeditorv2.dll.
Step 1:
Step 2:
5. Import the toolbox.
Right-click the toolbox
Click "select item ". Pop-up window:
Click Browse to find the dll Directory.
The FCKeditor Control is displayed in the toolbox.
6. Drag FCKeditor 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: basepath 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.
Userfilespath is the directory of all uploaded files. Why do we need to set it to/files instead ~ /Files, because FCKeditor uses 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.
Suggestion: it is better to separate files into a site under the wwwroot Directory, which is parallel to our site FCKeditor. Don't put it in FCKeditor. Why? Because files requires the user to have the write permission, it is dangerous to put the files in FCKeditor.
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. FCKeditor slimming it down. All headers starting with _ are sample files or source files, but we recommend that you be careful.
11. The following example shows how to use the image,
Click Browse server ".
An error is easily reported in the pop-up window.
If the XML request error: internal server error (500) is reported, it is likely that the directory path is incorrect and the write permission is not available.
Select Image
Final Effect
Front-end code:
<% @ Page Language = "C #" validaterequest = false autoeventwireup = "true" codefile = "default. aspx. cs" inherits = "_ default" %>
<% @ Register Assembly = "fredck. fckeditorv2" namespace = "fredck. fckeditorv2" tagprefix = "fckeditorv2" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> FCKeditor Text Editor </title>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Fckeditorv2: FCKeditor id = "fckeditor1" runat = "server" defaultlanguage = "ZH-CN" Height = "400px" width = "660px"
> </Fckeditorv2: FCKeditor>
</Div>
</Form>
</Body>
</Html>
How can I get the results? Fckeditor1.value is.
12. There is also a similar control freetextbox which is also very useful. If you are interested, you can find it on the Internet. It is much better than this one, but it doesn't feel better, and its latest version seems to be charged.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/21aspnet/archive/2007/04/11/1559848.aspx