ckeditor 在C#中使用
来源:互联网 发布:mac air 文件夹整理 编辑:程序博客网 时间:2024/05/16 11:06
1.将ckeditor和ckfinder文件夹拷入项目文件夹中,刷新项目。
2. 在添加编辑控件的页面(aspx)的head中加入
<script src="ckeditor/ckeditor.js" type="text/javascript"></script>
<script type="text/javascript" src="ckfinder/ckfinder.js"></script>
3.插入代码:
<asp:TextBox ID="i_content" runat="server" TextMode="MultiLine" Height="362px"
Width="100%"></asp:TextBox>
</div>
<script type="text/javascript">
CKEDITOR.replace('<%= i_content.ClientID %>', {skin : 'kama'});
</script>
4.在项目文件夹中加入uploads文件夹
5.把文件夹中的bin目录下的dll文件添加到网站的引用中,防止出现找不到类的错误。(未能加载类型“CKFinder.Connector.Connector”。)
6.修改页面的page指令ValidateRequest="false"
<%@ Page Language="C#" ValidateRequest="false" %>
7.获取或设置编辑器中的内容
//获取编辑器中的内容
lblView.Text=Server.HtmlEncode( this.i_content.Text);
//设置编辑器中的内容
//txtContent.Text = Server.HtmlDecode("<h1>设置内容</h1>");
一些用应中(如ajax应用)需要在客户端处理完所有的数据,然后用它自己的方式向服务器发送数据,在这些情况下,使用CKEditor API就足以轻松获取编辑器实例中的内容。例 如: <script type="text/javascript">
var editor_data = CKEDITOR.instances.i_content.getData();
</script>
8.加入中文字体:
打开CKeditor目录里的config.js,在
CKEDITOR.editorConfig = function( config )
{
};
里添加如下代码:
config.font_names='宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;'+ config.font_names;
- ckeditor 在C#中使用
- ckeditor 在C#中使用
- 在iOS5中使用CKEditor
- 在MVC3.0中使用Ckeditor【鸡蛋】
- 在ASP.NET项目中使用CKEditor
- 主题 : 在iOS5中使用CKEditor
- 在ASP.NET项目中使用CKEditor
- 在ASP.NET项目中使用CKEditor
- 在jsp页面中使用CKEditor
- 在jsp中使用CKEditor编辑器
- Sturts中使用CKEditor
- Django中使用CKEditor
- Wicket中使用ckeditor
- django中使用ckeditor
- 在JSP中使用JS方式引用ckeditor
- Drupal7如何使用CKEDITOR在文章中插入图片
- TP3.2.3使用CKeditor编辑器在页面中上传图片
- java 中 ckeditor 的使用
- 每天看一次 不久你就会变
- rh333 - 利用apache搭建简易https服务器
- 懒加载3种解决方案
- android自定义Spinner下拉菜单和AutoCompleteTextView自动显示的(下拉列表框)样式
- ASP.NET几种清除页面缓存的方法
- ckeditor 在C#中使用
- python获取硬件信息
- 看观察者怎么全方位观察机房收费系统
- JS中比较两个变量值的大小
- Zstack设置发送功率(CC2530)
- 编译httpsegmenter
- zoj-3323
- 如何在Eclipse Indigo 下编译和调试 HIVE 0.9 ( Hadoop 1.0.x )
- Python获取Linux下硬件温度的思路