asp.net CKEditor 와 CKFinder 의 응용

CKEditor 는 차세 대 FCKeditor 로 재 개 발 된 버 전 입 니 다.CKEditor 는 전 세계 에서 가장 우수한 웹 페이지 온라인 문자 편집기 중 하나 로 놀 라 운 성능 과 확장 성 으로 각 사이트 에 널리 활용 된다.CKFinder 는 기능 이 강 한 ajax 파일 관리자 입 니 다.간단 한 사용자 인터페이스 로 인해 각종 사용 자 는 고급 전문 인재 든 인터넷 초보 자 든 직관 적 이 고 신속하게 학습 하여 사용 할 수 있다.주소:CKEditor:http://ckeditor.com/ CKFinder :http://ckfinder.com/ CKEditor 사용 준비 작업 1.CKEditor 를 다운로드 하여 웹 루트 디 렉 터 리 에 압축 해제 2.디 렉 터 리 간소화:samples 폴 더(예제 파일,삭제 가능)source 폴 더(원본 파일,삭제 가능)changes.html(목록 업데이트,삭제 가능)install.html(설치 지향,삭제 가능)license.html(사용 허가,삭제 가능)CKEditor 설정(config.js 파일)상세 api 매개 변 수 는 다음 과 같 습 니 다.http://docs.cksource.com/ckeditor_api/,나의 기본 설정
 
// CKEditor
CKEDITOR.editorConfig = function(config) {
//
config.language = 'zh-cn'; //
// config.uiColor = '#FFF'; //
// config.width = 400; //
// config.height = 400; //
// config.skin = 'v2'; //
// “ ”
// config.resize_enabled = false;
//
// config.toolbar = "Basic";
//
config.toolbar = "Full";
//
// config.toolbar =
// [
// ['Source', 'Preview', '-'],
// ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', ],
// ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
// ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', SpecialChar','PageBreak'],
// '/',
// ['Bold', 'Italic', 'Underline', '-', 'Subscript', 'Superscript'],
// ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'],
// ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
// ['Link', 'Unlink', 'Anchor'],
// '/',
// ['Format', 'Font', 'FontSize'],
// ['TextColor', 'BGColor'],
// ['Maximize', 'ShowBlocks', '-', 'About']
// ];
};
CKEditor 의 응용 1.aspx 페이지 나 master 템 플 릿 페이지탭 에 ckeditor.js:2.페이지 를 수정 하 는 page 명령 ValidateRequest="false"<%@Page Language="C\#"ValidateRequest="false"%>3.탭 에서 ckeditor:4.편집기 의 내용 을 가 져 오 거나 설정 합 니 다./편집기 의 내용 lblView 를 가 져 옵 니 다.Text=Server.HtmlEncode(this.txtContent.Text);/편집기 의 내용//txtContent.Text=Server.HtmlDecode 설정("

설정 내용

");CKFinder 사용 준비 작업 1.CKFinder 의 Asp.NET 버 전 을 다운로드 하여 웹 루트 디 렉 터 리 에 압축 해제 2.복사/bin/Release 디 렉 터 리 에 있 는 ckfinder.dll 파일 을 사이트 bin 디 렉 터 리 로 복사 3.디 렉 터 리 간소화:samples 폴 더(예제 파일,삭제 가능)source 폴 더(원본 파일,삭제 가능)CKFinder 의 설정 1."\ckfinder\\config.ascx"를 열 면 SetConfig 방법의 BaseUrl 에 기본 경 로 를 지정 합 니 다.예 를 들 어//userfiles 를 기본 경로 로 하고 디 렉 터 리 에 images,flash 등 하위 디 렉 터 리 가 자동 으로 생 성 됩 니 다.BaseUrl = " ~/ckfinder/userfiles/"; // NOTE:"~/"주의 하 세 요.2.CKEditor 와 통합 하여 CKEditor 디 렉 터 리 의 config.js 파일 을 엽 니 다.function 함수 에
 
// CKEditor
CKEDITOR.editorConfig = function(config) {
……
};
다음 내용 을 추가 합 니 다.안전 상의 이유 로 파일 을 탐색 할 수 없습니다.시스템 관리자 에 게 연락 하고 CKFinder 설정 파일 을 확인 하 십시오.원인:사용자 인증 이 설정 되 지 않 았 거나 사용자 가 로그 인하 지 않 았 습 니 다.구문:
 
// CKEditor CKFinder, ckfinder 。
config.filebrowserBrowseUrl = location.hash + '/ckfinder/ckfinder.html';
config.filebrowserImageBrowseUrl = location.hash + '/ckfinder/ckfinder.html?Type=Images';
config.filebrowserFlashBrowseUrl = location.hash+'/ckfinder/ckfinder.html?Type=Flash';
config.filebrowserUploadUrl = location.hash + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files';
config.filebrowserImageUploadUrl = location.hash + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images';
config.filebrowserFlashUploadUrl = location.hash + '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash';
// config.filebrowserWindowWidth = '800';
// config.filebrowserWindowHeight = '500';
해결:CKFinder 의 config.ascx 파일 에서 Public override bool Check Authentication()을 수정 하여 사용자 인증 방법 을 추가 합 니 다.2.증상:알 수 없 는 오류 원인:사용자 인증 을 하지 않 지만 BaseUrl 경로 가 잘못 되 었 습 니 다.문장:
 
public override bool CheckAuthentication()
{
return false;
}
해결:CKFinder 의 config.ascx 파일 에 있 는 Public override void SetConfig()수정//userfiles 를 기본 경로 로 하고 디 렉 터 리 에 images,flash 등 하위 디 렉 터 리 가 자동 으로 생 성 됩 니 다.BaseUrl = " ~/ckfinder/userfiles/"; // NOTE:"~/"주의 하 세 요.3.증상:CKFinder 가 있 는 페이지 타 임 스 오류"HTTP 오류 404-Not Found"해결:CKFinder 컨트롤 의 BasePath 속성 을 ckfinder 디 렉 터 리 의 상대 경로 로 변경 합 니 다.

좋은 웹페이지 즐겨찾기