如何将CKEditor集成到Asp.net MVC中 [英] How to integrate CKEditor into Asp.net MVC

查看:76
本文介绍了如何将CKEditor集成到Asp.net MVC中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅FCKEditor的CodeProject中的这篇文章。有人可以解释一下新版本?

Saw this post at CodeProject for FCKEditor. Can someone explain what about the new version?

推荐答案

实际上很容易。首先从网站下载最新代码,并将其解压缩到项目中的目录(我选择/ Scripts / ckeditor )。然后在您的视图中,使用与链接中的完整示例 / a>,它应该工作。

It's pretty easy to do actually. First download the latest code from the website and extract it to a directory in your project (I choose /Scripts/ckeditor). Then in your view, use the same code as in the "complete sample" in this link and it should work.

基本上,重要的步骤是:

Basically, the important steps are:


  1. b $ b ckeditor.js文件在你的视图的头部或在你的master
    页面,但是你想做
    它。这需要是项目中的确切位置(我将使用查找文件对话框,您可以在Visual Studio编辑src属性时弹出,以便它自动链接到文件)。

  2. 放置:

  1. Make sure you include the ckeditor.js file in the head from your view or in your master page, however you want to do it. This needs to be the exact location within your project (I would use the find file dialog that you can popup when editing a src attribute in visual studio so that it automatically links to the file).
  2. Place the:

< script type =text / javascript>
CKEDITOR.replace('editor1');
< / script>

<script type="text/javascript"> CKEDITOR.replace( 'editor1' ); </script>

您的textarea之后,make
确保textarea的id是
,在CKEDITOR .replace()
语句。

RIGHT AFTER your textarea and make sure the id of the textarea is the same in the CKEDITOR.replace() statement.

这篇关于如何将CKEditor集成到Asp.net MVC中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆