我安装了逻辑上传器ckeditor在我的项目中,它的安装没有问题。我有以下控制器:ckeditor.js:219 Uncaught TypeError:无法设置未定义的属性'dir'
public class Default1Controller : Controller
{
//
// GET: /Default1/
Context _db = new Context();
[HttpGet]
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Index(content model)
{
_db.tbl_Content.Add(model);
_db.SaveChanges();
return View();
}
}
和我的内容模型:
public class content
{
[Key]
public int id { get;set; }
public string text { get; set; }
}
我的强类型的索引视图:
@model ckeditor.Models.content
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Index</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>content</legend>
<div class="editor-label">
@Html.LabelFor(model => model.text)
</div>
<div class="editor-field">
@Html.TextAreaFor(model => model.text)
@Html.ValidationMessageFor(model => model.text)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
<script src="~/Scripts/ckeditor/ckeditor.js"></script>
<script src="~/Scripts/ckeditor/adapters/jquery.js"></script>
<script>
$(function() {
$('#text').ckeditor();
});
</script>
}
,但我没有在我的@html.TextAreaFor()
CKEditor的又该我做?
看看控制台中的第一个错误 - 你的脚本的一个没有被发现(检查路径) –