This article mainly introduces the asp.net of CKEditor and Ckfinder in the configuration of the use of the relevant information, the need for friends can refer to the
Include CKEditor with Ckfinder in the project and add references to the assembly
Download CKEditor and Ckfinder from the Http://cksource.com website, and under the two unpacked items, the Samples folder inside is an example, it is not necessary to delete the Samples folder directly, Each has a bin directory under the CKEditor and Ckfinder directories, adding references to assemblies under the release directory in the bin directory
2. Register a user control on a page that requires a rich-text editor
The code is as follows:
<%@ Register assembly= "ckeditor.net" namespace= "ckeditor.net" tagprefix= "CKEditor"%>
3. Use of CKEditor
Add a rich-text editor, just as you would with your own user control, using the CKEditor
The code is as follows:
1. Integrated Ckfinder
Override Page's OnLoad method in the page's corresponding code page and integrate Ckfinder into CKEditor in the OnLoad method
The code is as follows:
protected override void OnLoad (EventArgs e)
{
Ckfinder.filebrowser browser = new Ckfinder.filebrowser ();
integrated into the corresponding ckeditor, the parameter is the corresponding ID
Browser. Setupckeditor (txtnewscontent);
Set up directories to save uploaded files
Browser. BasePath = "~/files/";
Base. OnLoad (e);
}
2. Configure Ckfinder
Ckfinder is a no refresh upload tool, for upload, there should be strict control of the rights, control mainly from two aspects: first, can not be uploaded to anyone, only authorized personnel can upload, second, can not be any file upload, to upload the file to control, You cannot have the user upload the executable file to the server to control the file type.
Open the Ckfinder directory of the Config.ascx, the first method is to verify the authorization, see whether the user has permission to upload files, you can verify the session, verify the user is authorized, the default is return FALSE, if not modified, direct use in the upload will be an error, No authorization cannot be uploaded if the test phase can be changed directly to return true; However, it is best to verify the permissions, not directly return true (I am here to verify that the user is logged in, if the login returns True, or false)
Continue to look down at the Setconfig () method set up some of the upload file configuration, such as the path to upload files saved, upload file type restrictions, etc., if you need to set the style you need to modify the Config.js file
The above is the entire contents of this article, I hope you can enjoy