Issues and Solutions of FCKeditor in ASP. NET

Source: Internet
Author: User

Tutorial FCKeditor 2.6.3 on ASP. NET

1. Set BasePath and UserFilesPath of FCKeditor.
BasePath is the root directory of FCKeditor, while UserFilesPath is the storage directory for uploaded images, files, and so on. In the FCKeditor folder (My FCKeditor is located in the root directory of the website), add the Web. Config file and add the following code in the <etettings> Configuration section:
<Add key = "FCKeditor: BasePath" value = "/FCKeditor/"/>
<Add key = "FCKeditor: UserFilesPath" value = "~ /UploadFiles/"/>
During the development process, UserFilesPath can use "~ /UploadFiles/", you may encounter two situations after the release: 1) running in the form of virtual directories, if you run your project as a virtual directory, the value of UserFilesPath does not need to be changed. 2) run on an independent website. If your website runs on an independent website "~ /UploadFiles/"to"/UploadFiles /". Otherwise, an error is reported!

2. Set the language used by the FCKeditor Upload Component.
There is a fckconfig. js file in the FCKeditor folder, which is the configuration file of FCKeditor. Find the following code:

Var _ FileBrowserLanguage = 'aspx '; // asp | aspx | cfm | lasso | perl | php | py
Var _ QuickUploadLanguage = 'aspx '; // asp | aspx | cfm | lasso | perl | php | py
As shown in the code above, set the values of _ FileBrowserLanguage and _ QuickUploadLanguage to ASPX. In addition, set the default language of the FCKeditor editor to 'zh-cn'. The Code is as follows:

FCKConfig. DefaultLanguage = 'zh-cn ';

3. Set the FCKeditor toolbar.
Open the fckconfig. js file and find the following code in the file:
1 FCKConfig. ToolbarSets ["Default"] = [
2 ['source', 'docprops', '-', 'save', 'newpage', 'preview', '-', 'templates'],
3 ['cut ', 'copy', 'paste', 'pastetext ', 'pasteword','-', 'print', 'spellcheck'],
4 ['undo ', 'redo', '-', 'Find ', 'replace', '-', 'selectall', 'removeformat'],
5 ['form', 'checkbox', 'Radio ', 'textfield', 'textta', 'select', 'click', 'imagebutton ', 'hiddenfield'],
6 '/',
7 ['bold ', 'italic', 'underline', 'strikethangout', '-', 'subscript', 'superscript'],
8 ['orderedlist', 'unorderedlist', '-', 'outdent ', 'indent', 'blockquote', 'creatediv '],
9 ['justifyleft', 'justifycenter', 'justifyright', 'justifyfull'],
10 ['link', 'unlink', 'anchor '],
11 ['image', 'flash', 'table', 'rule', 'smiley ', 'specialchar', 'pagebreak'],
12 '/',
13 ['style', 'fontformat', 'fontname', 'fontsize'],
14 ['textcolor', 'bgcolor'],
15 ['fitwindow', 'showbuckets', '-', 'about'] // No comma for the last row.
16];
17
18 FCKConfig. ToolbarSets ["Basic"] = [
19 ['bold ', 'italic', '-', 'orderedlist', 'unorderedlist', '-', 'link', 'unlink ','-', 'about']
20];
This Code defines two formats of the FCKeditor toolbar: Default and Basic. You can also set the toolbar as needed by the project. '-' indicates a vertical line between the buttons, and the content in two [] indicates a tool button that can be combined, '/' indicates line feed. I have defined a simple toolbar:

FCKConfig. ToolbarSets ["Post"] = [
['Source', '-', 'bold ', 'italic', 'underline', '-', 'orderedlist', 'smiley '],
['Fontformat', 'fontname', 'fontsize', 'textcolor'],
['About']
];
In this way, you can use it on the ASP. NET page. The Code is as follows:

<Fckeditorv2: fckeditor id = "txtBody" runat = "server" ToolbarSet = "Post" Height = "400px" Width = "96%"/>

  • Four pages in total:
  • Previous Page
  • 1
  • 2
  • 3
  • 4
  • Next Page

Related Article

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.