Use FCKeditor in. net

Source: Internet
Author: User

The webproject directory demo, decompress fckeditor_2.2.zip, and save it under demo/FCKeditor. The user uploads the file directory demo/userfiles.
1. Set
Editor. linkbrowserurl = request. applicationpath + "/FCKeditor/Editor/filemanager/Browser/default/browser.html? Connector = connectors/aspx/connector. aspx ";
Editor. imagebrowserurl = request. applicationpath + "/FCKeditor/Editor/filemanager/Browser/default/browser.html? Type = Image & connector = connectors/aspx/connector. aspx ";
2. Decompress fckeditor.net_2.2.zip and modify the file to regenerate the DLL file.
2.1 modify the basepath attribute in FCKeditor. CS.

[Defaultvalue ("~ /FCKeditor/")]
Public String basepath
{
Get
{
Object o = viewstate ["basepath"];

If (O = NULL)
O = system. configuration. configurationmanager. receivettings ["FCKeditor: basepath"];

Return (O = NULL? "~ /FCKeditor/": (string) O );
}
Set {viewstate ["basepath"] = value ;}
}

2.2 modify fileworkerbase. CS to add the member variable private const string default_user_files_dir = "/userfiles /";
Add attribute

Protected string userfilesdirectoryforupload
{
Get
{
Return server. mappath (default_user_files_dir );
}

}

Add return request. applicationpath + default_user_files_dir in the userfilespath attribute;
2.3 modify uploader. CS sets string sfilepath = system. io. path. combine (this. userfilesdirectory, sfilename); changed to string sfilepath = system. io. path. combine (this. userfilesdirectoryforupload, sfilename );
3. The solution for FCKeditor to upload a Chinese file name
The main modification file is the frmupload.html file. the modification method is as follows: Rename the frmupload.html file, add An ASPX page file, copy the above content to the ASPX page file, and change the suffix of the newly added aspx file to HTML. the modified file content is as follows:
<% @ Page Language = "C #" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en ""

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.