Hướng dẫn đưa FCK Editor vào web ASP.NET

Hướng dẫn đưa FCK Editor vào web ASP.NET

A - Tổng quan về FCKEditor

FCKEditor là một công cụ soạn thảo mã nguồn mở (giống như Microsoft Word) mà có thể tích hợp vào ứng dụng web như (asp/asp.net, php, coldFusion,Java,Python…).

FCK là từ viết tắt của Frederico Caldeira Knabben, nó hổ trợ hầu hết các trình duyệt bao gồm: internet Explorer 5.5+(Window), Firefox 1.0+, Safari 3.0+, Opera 9.5+, Mozilla 1.3+ và Netscape.

B - Cấu hình và tích hợp

FCK editor phát hành bao gồm 1 gói javascript và 1 thành phần (component) dành cho .NET, để có thể nhúng FCK vào 1 ứng dụng web asp.net, chúng ta cần phải tải đủ 2 gói này tại đây: http://ckeditor.com/download hoặc http://www.mediafire.com/?umzzn130tyu

Sau khi đã download xong tiến hành theo các bước sau:

Bước 1:

Giải nén file tải về, bạn sẽ thấy 1 thư mục tên fckeditor chứa mã nguồn gốc của điều khiển và compnent FredCK.FCKeditorV2.dll

Bước 2:

Mở Visual Studio 2010 tạo một ứng dụng Web Application với ngôn ngữ C#, đặt tên tùy ý như hình sau:

Hướng dẫn đưa FCK Editor vào web ASP.NET

- Tiến hành copy tập tin "FredCK.FCKeditorV2.dll" trong thư mục "fckeditor" vừa giải nén vào thư mục Bin trong ứng dụng vừa tạo.
- Kích chuột phải vào "References" chọn Add References/ Browse tham chiếu đến file "FredCK.FCKeditorV2.dll" vừa được lưu ở bước trên.
- Copy cả thư mục mã nguồn của ECKEditor vào thư mục root của ứng dụng. Xem chi tiết trong hình dưới đây:

Bước 3: Để sử dụng control FCK, ta phải add vào hộp công cụ toolbox bằng cách từ menu trong VS chọn Tool/ Choose Toolbox Items/ Browse tìm đến file “FredCK.FCKeditorV2.dll” trong thư mục “Bin” à Ok

Bước 4: Bây giờ FCK đã sẵn sàng để được sử dụng trong ứng dụng web, để control vào page. Có hai cách lựa chọn:

  1. Kéo thả contron FCKeditor từ hộp Toolbox vào trang.
  2. Tự thêm dòng mã nguồn sau vào đầu trang ASP.Net

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

- Tiếp tục thêm đoạn mã thẻ sau trong nội dung của trang:
<FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server"></FCKeditorV2:FCKeditor>

Chạy chương trình để xem kết quả:

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Adding Metadata to Drupal Nodes

Thêm Metadata cho Drupal Nodes để Seo

This week's tutorial explains how to add metadata to your Drupal site. By default, Drupal has no fields for metadata. Check the source code at http://drupal.org and you'll see what I mean. To fix that issue, we recommend a module called Nodewords.

How to Recover your Lost or Stolen Digital Camera

How to Recover your Lost or Stolen Digital Camera

Lost your favorite Digital camera, don’t worry now you can easily track your lost digital camera with Stolen Camera Finder website.

Cấu trúc file, install, module views trong Drupal 8

Cấu trúc file, install, module views trong Drupal 8

Over the last few months, we've been covering the Drupal community's progress towards releasing Drupal 8.

Công ty diệt chuột T&C

 

Diet con trung