Asp.net 无法在partailview中获取ckEditor

Asp.net 无法在partailview中获取ckEditor,asp.net,asp.net-mvc-3,Asp.net,Asp.net Mvc 3,我正在使用asp.net MVC3。我需要在部分视图中使用ckeditor 在控制器中: public PartialViewResult Compose() { return PartialView(); } 我的观点包括 <% using (Html.BeginForm()) { %> <%: Html.TextArea("Body", signature , new { @class = "ckeditor",

我正在使用asp.net MVC3。我需要在部分视图中使用ckeditor

在控制器中:

public PartialViewResult Compose()
        {
            return PartialView();
        }
我的观点包括

<% using (Html.BeginForm()) { %>

 <%: Html.TextArea("Body", signature , new { @class = "ckeditor", rows = "5", cols = "15"})%> 

<% } %>

我使用的是ASP.NET MVC 3,概念应该是相同的

首先将所有库导入项目的根文件夹 否则,文件的某些依赖项将丢失

将此js文件包含到您的视图中

<script type="text/javascript" src="@Url.Content("~/ckeditor.js")"></script>
在视图中,使用脚本加载局部视图

@using (Html.BeginForm()){
     @Html.TextArea("body", new { @id = "editor1", name = "editor1", rows = "30", cols = "100" })
}

<script type="text/javascript">
     CKEDITOR.replace('editor1');
</script>
@使用(Html.BeginForm()){
@TextArea(“body”,new{@id=“editor1”,name=“editor1”,rows=“30”,cols=“100”})
}
CKEDITOR.replace('editor1');

@using (Html.BeginForm()){
     @Html.TextArea("body", new { @id = "editor1", name = "editor1", rows = "30", cols = "100" })
}

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