ASP.NET配置CKeditor

基本步骤:

1.下载CKeditor

官网网址:http://ckeditor.com/ 

下载版本:完整包

CKEditorFully functional, open source editor, with source code included

当前最新为CKEditor 3.6.2

 

2.在需要使用CKeditor的页面<head>中引入ckeditor核心文件ckeditor.js

注:文件夹ckeditor,要与该页面处于同一目录下。

例如:

<head runat="server">

    <title></title>

    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>

</head>

 

3.在使用编辑器的地方插入ASP.NET服务器端控件<TextBox>,引入class="ckeditor"

例如:

<asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine" class="ckeditor"></asp:TextBox>

 

4.将相应的控件替换成编辑器代码

注:replace方法的参数要为第三步TextBox控件的ID【txtContent】

此段代码放到页面最后就可以。

例如:

<script type="text/javascript">

    CKEDITOR.replace('txtContent');

</script>

 

运行程序即可!

转至:http://www.58soft.com.cn/information_content/2283.aspx

posted on 2013-08-06 15:20  寒皑释融  阅读(131)  评论(0编辑  收藏  举报

导航